Randomly Spreading players into Teams

Discussion in 'Plugin Development' started by Zeryther, Apr 13, 2014.

Thread Status:
Not open for further replies.
  1. Used the search function, no answer found ..

    Hey Bukkit Community & Devs!

    Right to the problem:
    I've got 4 teams in a scoreboard and want my players to be spreaded into those teams randomly. Basically there are 4 - 24 players online. Does anybody know any way to do that. I've googled and googled but didn't find the right solution.
     
  2. Offline

    Bammerbom

    Zeryther
    1. Loop through the players you want to join a team
    2. Check for the teams (Can be more then 1) with the lowest amount of players inside.
    3. Get random 1 of the teams with the lowest amount and add the player.
     
  3. Jhtzb
    I'm not quite sure what you mean.. Could you explain that a little bit more or send me a code snippet?
     
Thread Status:
Not open for further replies.

Share This Page