while true do game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() print(Player.Team.Name) if Player.Team.Name == Blue then Player.Team.Name = Red else Player.Team.Name = Blue wait(0.5) end end
It just gives me an EOF error in the output.
It prints the name and if the team is blue then change it to red , vice versa.
Hello, RebornedSnoop!
The reason it was giving you some errors was because you messed up some of the ends. Also, when assigning a player to a team your suppose to put the team name in quotes (you will see that in this script). Also your while loop isn't needed so I removed it.
If you come across any errors feel free to reply to this and let me know!
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() print(player.Team.Name) if player.Team.Name == "Blue" then player.Team = game.Teams:WaitForChild("Red") print(player.Team.Name) else player.Team = game.Teams:WaitForChild("Blue") print(player.Team.Name) wait(0.5) end end) end) end)