of     1   

RAFiredog
#184822220Saturday, March 05, 2016 11:26 PM GMT

--Assigns players to teams function assignPlayers() print("Assigning Teams") local g=0; local t=0; for _,player in pairs(game.Players:GetChildren()) do player.Neutral = false if player.TeamColor == "White" then if t+1<=g then player.TeamColor = BrickColor.new("Really black") t = t+1 elseif g+1<=t then player.TeamColor = BrickColor.new("Bright blue") g = g+1 else if math.random(1,2)==2 then player.TeamColor = BrickColor.new("Really black") t = t+1 else player.TeamColor = BrickColor.new("Bright blue") g = g+1 end end end player.Character.Humanoid:TakeDamage(1000) end end The problem I have with my assigning script is that it doesn't change my TeamColor. It will remain the default "White", which creates an endless loop of death. Any ideas?
RAFiredog
#184822915Saturday, March 05, 2016 11:38 PM GMT

it also seems that it keeps assigning you. I manually changed the TeamColor to a valid one. I died then spawned in the correct location, but it kept assigning me and wouldn't break out of the loop.
RAFiredog
#184824150Saturday, March 05, 2016 11:59 PM GMT

Fixed. Thanks me! anyway the reason it was looping was because I accidently put it in my loop elsewhere. and it wasn't assigning a color because the first if statement said if the TeamColor == "White", which it didn't understand so it skipped EVERYTHING else. what I did to fix it was the if statement right below the for loop I said if player.TeamColor == BrickColor.new("White") then ... end if you need an auto assign script, here you go. Works fine. any questions just shoot me a message! --Assigns players to teams function assignPlayers() print("Assigning Teams") local g=0; local t=0; for _,player in pairs(game.Players:GetChildren()) do player.Neutral = false if player.TeamColor == BrickColor.new("White") then if t+1<=g then player.TeamColor = BrickColor.new("Really black") t = t+1 elseif g+1<=t then player.TeamColor = BrickColor.new("Bright blue") g = g+1 else if math.random(2) == 1 then player.TeamColor = BrickColor.new("Really black") t = t+1 else player.TeamColor = BrickColor.new("Bright blue") g = g+1 end end end player.Character.Humanoid:TakeDamage(1000) end end

    of     1