Sending player to another ONLINE server

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

xdprojosh1

Member
May 31, 2017
23
0
0
25
I got a /stop script that will stop the server (WildSkript) and will send the player to another server (Skellett, SkellettProxy),

Is it possible to make make it so if it's offline, then send the player to another server. Because right now it is just a simple script that will send the player to Lobby 2, but if that server is down, then the player will just get kicked from the whole network.

code_language.skript:
command /stop:
    trigger:
        command sender is console:
            loop all players:
                send "%loop-player%" to bungeecord server "Lobby-2"
                shutdown server
        else:
            send "Unknown Command"
 
code_language.skript:
command /stop:
    trigger:
        command sender is console:
            loop all players:
                send "%loop-player%" to bungeecord server "Lobby-2"
            wait a tick
            shutdown server
        else:
            send "Unknown Command"
 
  • Like
Reactions: xdprojosh1
@aescraft
If Lobby-2 is offline, it will try to send the player to that server, but it wont work, so the player stays in Lobby-1, and lobby 1 shuts down, so the player just gets kicked, is there a way to check if lobby-2 is online or not, and if not, then send the player to the next server, Lobby-3 ?
@HiiqhFive That wont solve anything. If Lobby2 is offline, it will still stop the server
[doublepost=1496673734,1496623701][/doublepost]bump.
 
There is a expression syntax to test if a bungeecord server is offline. So you can test yourself then find a server that is open.
code_language.skript:
[the] [(skellett[ ][(cord|proxy)]|bungee[ ][cord])] online [stat(us|e)] of (skellett[ ][(cord|proxy)]|bungee[ ][cord]) server %string%
Example:

code_language.skript:
function sendServer(p: text, server: text):
    if online status of bungeecord server {_server} is true:
        send "%{_p}%" to bungeecord server {_server}
    else:
        loop all bungeecord servers:
            if online status of bungeecord server "%loop-value%" is true:
                send "%{_p}%" to bungeecord server "%loop-value%"
                stop
The {_p} parameter of the function accepts a bungeecord UUID or a username. SkellettProxy will determine what it is and handle it automatically.
code_language.skript:
sendServer("%player%", "Hub")
#or
sendServer("%bungeecord uuid of player%", "Hub") #I recommend if you have an online mode bungeecord
 
Status
Not open for further replies.