Skungee send player to another bungee 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.

ThePlay3r

New Member
Jun 10, 2018
5
0
0
21
So, Im making my own server selector plugin with Skungee, and I have this:
code_language.skript:
on inventory click:
    if event-item is iron pickaxe named "&d&lResidence":
        set {_h} to player's name
        skungee send players "%{_h}%" to bungeecord server "resky"
And if somehow click on pickaxe it send all players on server to server "resky". But I don't want that. I want to send only the player who clicked on iron pickaxe, how can I do it?
 
you used "players" which gets interpreted as alias for "all players" (i think). use this:
code_language.skript:
on inventory click:
    event-item = iron pickaxe named "&d&lResidence"
    skungee send event-player to bungeecord server "resky"
 
Last edited:
Well, now it works, but when any player click the iron pickaxe, he got teleported to the server, thats okay. But when he get back to lobby server and another player click iron pickaxe it teleports all players who clicked it before. Why it is doing that? ._.
 
code_language.skript:
on inventory click:
    if event-item is red glass named "&eZavrit":
        play "BLOCK_IRON_DOOR_CLOSE" to player at volume 1
    else if event-item is iron pickaxe named "&d&lResidence" with lore "&e&l- &eResidence||&e&l- &eSpec. Itemy||&e&l- &eDungeony":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eResky &7]"
        wait 1 second       
        skungee send event-player to bungeecord server "resky"
    else if event-item is diamond sword named "&d&lFactions" with lore "&e&l- &eFrakce||&e&l- &eKoTH||&e&l- &eRPG":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eFrakce &7]"
        wait 1 second   
        skungee send event-player to bungeecord server "frakce"
    else if event-item is grass named "&d&lSkyBlock" with lore "&e&l- &eSkyBlock||&e&l- &eObchod||&e&l- &eEventy":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eSkyBlock &7]"   
        wait 1 second           
        skungee send event-player to bungeecord server "resky"
    else if event-item is dispenser named "&d&lCreative" with lore "&e&l- &eCreative||&e&l- &eParcely||&e&l- &eTagy":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eCreative &7]"
        wait 1 second       
        skungee send event-player to bungeecord server "creative"
    else if event-item is glowing compass named "&5&l&nM&d&l&ni&5&l&nn&d&l&ni&5&l&nh&d&l&nr&5&l&ny" with lore "&eSpousta zabavy!":
        play "BLOCK_ENDERCHEST_CLOSE" to player at volume 1
        message "&8&l[&4&l!&8&l] &cMinihry se pripravuji!"
 
code_language.skript:
on inventory click:
    if event-item is red glass named "&eZavrit":
        play "BLOCK_IRON_DOOR_CLOSE" to player at volume 1
    else if event-item is iron pickaxe named "&d&lResidence" with lore "&e&l- &eResidence||&e&l- &eSpec. Itemy||&e&l- &eDungeony":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eResky &7]"
        wait 1 second   
        skungee send event-player to bungeecord server "resky"
    else if event-item is diamond sword named "&d&lFactions" with lore "&e&l- &eFrakce||&e&l- &eKoTH||&e&l- &eRPG":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eFrakce &7]"
        wait 1 second
        skungee send event-player to bungeecord server "frakce"
    else if event-item is grass named "&d&lSkyBlock" with lore "&e&l- &eSkyBlock||&e&l- &eObchod||&e&l- &eEventy":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eSkyBlock &7]"
        wait 1 second       
        skungee send event-player to bungeecord server "resky"
    else if event-item is dispenser named "&d&lCreative" with lore "&e&l- &eCreative||&e&l- &eParcely||&e&l- &eTagy":
        message "&8&l[&e&l?&8&l] &ePrepojuji na server... &7[ &eCreative &7]"
        wait 1 second   
        skungee send event-player to bungeecord server "creative"
    else if event-item is glowing compass named "&5&l&nM&d&l&ni&5&l&nn&d&l&ni&5&l&nh&d&l&nr&5&l&ny" with lore "&eSpousta zabavy!":
        play "BLOCK_ENDERCHEST_CLOSE" to player at volume 1
        message "&8&l[&4&l!&8&l] &cMinihry se pripravuji!"

according to the documentation, your syntax is incorrect:
code_language.skript:
[skungee] (send|connect) bungee[[ ]cord] [(player|uuid)[s]] %strings/players% to [bungee[[ ]cord]] [server[s]] %string%
[skungee] (send|connect) [(player|uuid)[s]] %strings/players% to [bungee[[ ]cord]] server[s] %string%

so try:
code_language.skript:
skungee send bungeecord event-player to bungeecord server "xxx"

since its a player event i would use %player%



edit: works for me
whether you use event-player or player doesn't make a difference here. at this point it's a matter of taste
 
Status
Not open for further replies.