HyperScript
Docs

← All of the Docs HyperVelocity

Asking another server HyperVelocity

expressionrequest variable {<name>} from server <name>HyperVelocity

Ask another server what it has in that variable. When the answer comes, the variable here is set to it

request variable {%player%.coins} from server "survival"
eventon receive variable <name>:HyperVelocity

Runs when such an answer has arrived. {_value} is what came, {_owner} the player it belongs to (empty for a variable that is nobody's), {_sender_server} who answered

on receive variable "coins":
    send "&7Your coins on survival: &f%{_value}%" to {_owner}

What this event gives a script

In the blockWhat it is
{_value}What came
{_owner}The player it belongs to (empty for a variable that is nobody's)
{_sender_server}Who answered
Guide and examples

send variable pushes a value to another server. This asks for one instead:

command /coins:
    players only: true
    trigger:
        request variable {%player%.coins} from server "survival"
        send "&7Asking the survival server..."

on receive variable "coins":
    send "&7Your coins on survival: &f%{_value}%" to {_owner}
SyntaxEffect
request variable {<name>} from server <name>Ask another server what it has in that variable. When the answer comes, the variable here is set to it
on receive variable <name>:Runs when such an answer has arrived. {_value} is what came, {_owner} the player it belongs to (empty for a variable that is nobody's), {_sender_server} who answered
  • Nothing waits for the answer: the lines after request variable run at once, and the answer comes a moment later, in on receive variable. Without that block the variable is still set.
  • The name in on receive variable "coins": is the variable's name without the player: {%player%.coins} arrives as coins.
  • The answer is taken in like any variable that is sent, so accept-variables here applies to it. What a server gives out is decided by its own share-variables.