So I have a script, but instead of splitting the teams evenly, it puts everyone on the same team.
for i, player in pairs(game.Players:GetPlayers()) do
if rval < dval then
player.TeamColor = BrickColor.new("Bright red")
rval = rval + 1 -- you forgot to add the new player to the team value
elseif rval > dval then
player.TeamColor=BrickColor.new("Bright blue")
dval = dval + 1 -- and here too
else
How would I have this (Or a different script) split the teams evenly?
I know it would have to take each individual player, but Im 95% certain this takes all the players, instead of one at a time

1 comment
The for loop iterates to code for each player one at a time, so no problem there. Also, take out the elseif and replace it with else. That way it has somewhere to go in case they were equal.