Sorting players into teams

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

Jimsk

Member
Mar 13, 2020
21
1
3
23
I am trying to sort all players in a list into 2 teams, hiders and seekers. It isnt showing any errors, and seems to be "working" but doesnt sort the players into the teams, only makes them seek. Help would be appriciated, thanks, Jimsk.

Code:
command /start:
    trigger:
        loop all players:
            set {player::*} to loop-player
            set {seaker::*} to a random element out of {player::*}
            remove {seaker::*} from {player::*}
            wait 1 tick
            set {hider::*} to {player::*}
            broadcast "%{seaker::*}%"
            broadcast "%{hider::*}%"
 
it is most likely because you are setting the list variable to the loop-player instead of adding the loop-player to the list variable.
[doublepost=1588950542,1588950463][/doublepost]Also I think you can just remove the "wait 1 tick", I don't see why you would need to wait there :emoji_slight_smile:
 
So what would be a code to fix this, and the wait 1 tick was me trying to troubleshoot the problem.
 
Status
Not open for further replies.