game.Players.LocalPlayer.CharacterAdded:connect(function(Character) Character:WaitForChild('Humanoid').Died:connect(function() game.Players.LocalPlayer.TeamColor = BrickColor.new("White") end) end)
This script basically changes the player's TeamColor to White when they die, and even though it works most of the time, on occasion, it breaks. Any help with why this might be happening?
Hmm, maybe try the teamnames teamcolor?
example:
game.Players.LocalPlayer.TeamColor = game.Teams.TeamName.TeamColor
I'm not sure what you mean by it breaking, but if you handled it on the server, maybe that would resolve your issue. (And would prevent complications if you decided to turn FilteringEnabled on)
Edited example from wiki
game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() player.TeamColor = BrickColor.new("White") end) end) end)
Hope I helped! If this works, don't forget to accept my answer!