How do you divide team red, and blue evenly with players? Can somebody give me an example in code, and explain what each part of code does?
Answered it here: How do I make this spread the teams equally?
rval = 0 -- a value to count players in red team bval = 0 -- in blue team for i, player in pairs(game.Players:GetPlayers()) do -- get the players if rval < bval then -- if one has more players than the other player.TeamColor = BrickColor.new("Bright red") rval = rval + 1 -- adding the player to the value elseif rval > bval then -- the inverse player.TeamColor=BrickColor.new("Bright blue") bval = bval + 1 else -- if they're equal player.TeamColor = BrickColor.new("Bright red") rval = rval + 1 end end
Marked as Duplicate by User#2
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?