Help please with join cmd

  • 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.

Avanty

Member
Jul 10, 2017
1
0
0
24
Hi, i really hope about help with this...
I write minigame, but i dont know how to teleport "marked" player's to arena.
I added player to variable for loop, but one player's teleported to arena, but 2nd player no.

Thanks for help :emoji_slight_smile: and sorry for my english.

Code:
        if arg-1 is "joindebug":
            if arg-2 is set:
                set {gkmplayers.%arg 2%} to 0
                send "&6Developer: &7Variable &e{gkmplayers.%arg 2%} &7debugged."
        if arg-1 is "join":
            if arg-2 is set:
                if {arena.%arg 2%} exists:
                    if {arenatoggle.%arg 2%} is true:
                        if {gkmplayers.%arg 2%} is less than 2:
                            add 1 to {gkmplayers.%arg 2%}
                            set {gkmstart.%arg 2%} to true
                            teleport player to {waitlobby}
                            broadcast "{@prefix} Player &c%player% &7joined to arena &9%arg 2% &7(&6%{gkmplayers.%arg 2%}%&7/&6%{gkmmax.%arg 2%}%&7)"
                            if {gkmplayers.%arg 2%} is bigger than 1:
                                set {gkmtime.%arg 2%} to 5
                                add player to {_player::*}
                                add {_player::*} to {gkmloop.%arg 2%}
                                if {gkmtime.%arg 2%} is 5:
                                    set action bar of player to "&7&lArena starts in &4&l5 &7&lseconds"
                                    wait 1 seconds
                                    set action bar of player to "&7&lArena starts in &4&l4 &7&lseconds"
                                    wait 1 seconds
                                    set action bar of player to "&7&lArena starts in &4&l3 &7&lseconds"
                                    wait 1 seconds
                                    set action bar of player to "&7&lArena starts in &4&l2 &7&lseconds"
                                    wait 1 seconds
                                    set action bar of player to "&7&lArena starts in &4&l1 &7&lseconds"
                                    wait 1 seconds
                                    set action bar of player to "&7&lArena starting..."
                                    if {gkmloop.%arg 2%} is set:
                                        loop all players:
                                            if loop-player is {_player::*}:
                                                chance of 100%:
                                                    execute loop-player command "/gkmarena test testte 1"
                                                chance of 100%:   
                                                    execute loop-player command "/gkmarena test testte 2"
                                            else:
                                                send "&cNot works"
                                    else:
                                        send "bugged"
                                else:
                                    stop
                            else:
                                stop
                        else:
                            send "{@prefix} &cSorry, but arena is full"
                    else:
                        send "{@prefix} Arena &c%arg 2% &7is off"
                else:
                    send "{@prefix} &cThis arena doesn't exist"
            else:
                send "{@prefix} &cBad use: &7/gkm join <arena_name>, Available arenas: /gkm list"


 
You have to make the gmkplayers variable a list variable, and loop that
 
Status
Not open for further replies.