children = game.Players:GetChildren()
team1 = ("Bright blue")
team2 = ("Bright red")
children = team1 ("Bright blue")
if Player.Humanoid.Health = 0 then
children = team2 ("Bright red")
end
✓ ANSWER ACCEPTED
Would this team changing script work?
2 answers
✓ Accepted answer
From my understanding, you want everyone to start on the blue team? And by some natural disaster or NPC, they go on the red team? If so, you'd need the Died event. If you want this to repeat, just put it in a while true do loop with a wait time of each round.
game.Players.PlayerAdded:connect(function(p)
--p.TeamColor = BrickColor.new("Bright blue")
--above is if you want it so when they join they go on that team. (Incase you don't have a script that sorts that out)
p.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
p.TeamColor = BrickColor.new("Bright red")
end)
end)
end)
No you failed an If and Then statement.
children = game.Players:GetChildren()
team1 = ("Bright blue")
team2 = ("Bright red")
children = team1 ("Bright blue")
if Player.Humanoid.Health == 0 then
children = team2 ("Bright red")
end
I didnt see anything wrong other than that.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I can still see many flaws. You never accessed their teamcolor to change it to a BrickColor... Also, for line 8, you'd need a loop to repeat it because it needs to keep checking if they die. One more tip, sometimes, their health goes below 0 so it may be able to bypass line 8.