Runs on this server when somebody joins the network, whichever server they arrive on. {_player} is their name and {_server} where they arrived. With a name, on network join "lobby":, only for that server
on network join:
broadcast "&a+ &f%{_player}% &7joined the network on &f%{_server}%"
What this event gives a script
In the block
What it is
{_player}
Their name
{_server}
Where they arrived
eventon network leave:HyperVelocityexample
Runs when somebody leaves the network. {_player} is their name and {_server} the server they were last seen on
on network leave:
broadcast "&c- &f%{_player}% &7left the network"
What this event gives a script
In the block
What it is
{_player}
Their name
{_server}
The server they were last seen on
eventon server switch:HyperVelocityexample
Runs when somebody goes from one server to another. {_player}, {_from} and {_server}, which is where they are now. With a name, only for arrivals on that server
on server switch:
log "%{_player}% went from %{_from}% to %{_server}%"
What this event gives a script
In the block
What it is
{_player}
Their name
{_from}
And
{_server}
Which is where they are now
expressionnetwork server of <who>HyperVelocityexample
Which server of the network a player is on, by its name on the proxy; unset if they are on none. As of the last refresh for a player on another server
set {_server} to network server of arg.1
expressionping of server <name>HyperVelocityexample
How long that server took to answer the last time it was tried, in milliseconds, measured from this server; unset if it did not answer
set {_ms} to ping of server arg.1
Guide and examples
on network join:
broadcast "&a+ &f%{_player}% &7joined the network on &f%{_server}%"
on network leave:
broadcast "&c- &f%{_player}% &7left the network"
on server switch:
log "%{_player}% went from %{_from}% to %{_server}%"
on server switch "survival":
broadcast "&f%{_player}% &7has arrived from &f%{_from}%"
command /find <name>:
trigger:
set {_server} to network server of arg.1
if {_server} is set:
send "&f%arg.1% &7is on &f%{_server}%&7."
else:
send "&7%arg.1% is not on the network."
command /lag <server>:
trigger:
set {_ms} to ping of server arg.1
if {_ms} is set:
send "&7%arg.1% answers in &f%{_ms}% ms"
else:
send "&c%arg.1% is not answering."
Syntax
Effect
on network join:
Runs on this server when somebody joins the network, whichever server they arrive on. {_player} is their name and {_server} where they arrived. With a name, on network join "lobby":, only for that server
on network leave:
Runs when somebody leaves the network. {_player} is their name and {_server} the server they were last seen on
on server switch:
Runs when somebody goes from one server to another. {_player}, {_from} and {_server}, which is where they are now. With a name, only for arrivals on that server
network server of <who>
Which server of the network a player is on, by its name on the proxy; unset if they are on none. As of the last refresh for a player on another server
ping of server <name>
How long that server took to answer the last time it was tried, in milliseconds, measured from this server; unset if it did not answer
These are noticed by comparing the lists of players from one refresh to the next, so they run up to refresh-seconds after it happened, and somebody who joins and leaves between two refreshes is never seen.
The player is usually on another server, so there is no player in these blocks: the name is in {_player}. Every server that has HyperVelocity runs its own blocks, so a message to the whole network belongs on one of them only.
What a player was seen doing before this server started, or before its first refresh, sets what is known and runs nothing.