When a player dies , the players team is switched. (Die on Dark blue switch to Really red) There are only two teams. First team - "Dark blue" (Colour of the team). Second team - "Really red".
player = game.Players.LocalPlayer
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
if player.TeamColor.BrickColor.Name == ("Dark blue") then
player.TeamColor.BrickColor.Name = ("Really red")
else
player.TeamColor.BrickColor.Name = ("Dark blue")
end
I feel like the 3rd to 5th line has an error but just can spot it.

2 comments
is there an error in the output?
Yes "Workspace.Team change when die.:13: Expected 'end' (to close 'function' at line 3), got "