Solved Better autojoin.

  • 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 community!

    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.

Uzumaki

Well-Known Member
Feb 20, 2017
310
10
18
when I do /join to join in the arena with most players

code_language.skript:
command /test:
    trigger:
        loop {sg.arenas::*}:
            if {sg.arena.%loop-value%.status} is "{@waiting}" or "{@starting}":
                send "&7Arena founded!"
                make player execute the command "/sg join %loop-value%"
                stop loop
                stop

{sg.arena.%text arg 2%.playing} = player count.

Thanks.
 
Just loop the arena, then check

code_language.skript:
if {...} is more than {_foundarena}:
    set {_foundarena} to (number of online player there)
    set {_foundarenaName} to Name of arena.

after loop finished, there you gi
 
What failed? Common


#edit

Tested and work:


code_language.skript:
command /makearena [<text>] [<integer>]:
    trigger:
        set {SG.Arena::%arg-1%} to "%arg-1%"
        set {SG.Arena::%arg-1%.AmountsPlayers} to arg-2
        send "Arena %arg-1% got %arg-2% amount players"

command /top:
    trigger:
        set {_highest} to 0
        loop {SG.Arena::*}:
            if {SG.Arena::%loop-index%.AmountsPlayers} is more than {_highest}:
                set {_highest} to {SG.Arena::%loop-index%.AmountsPlayers} # Amount of player
                set {_Name} to "%loop-index%"#Arena Name
        send "We found a arena with highest player:"
        send "&e%{_Name}% &rwith &e%{_highest}%&r amount player"

upload_2017-11-30_2-46-32.png
 
Last edited:
  • Like
Reactions: Uzumaki
Status
Not open for further replies.