local team = game.Teams.Lobby game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(chr) chr:WaitForChild("Humanoid").Died:connect(function() print(plr.Name.." died!") plr.TeamColor = team end) end) end)
Trying to make a script in workspace where when you die you change from Team Players to Team Lobby.
Again, It's best to use Team
instead of TeamColor
. It isn't working because your setting the player's TeamColor
to a Team object, not a Team color.
game.Players.ChildAdded:connect(function(newPlayer) newPlayer.CharacterAdded:connect(function(newCharacter) newCharacter.Humanoid.Died:connect(function() --When player dies newPlayer.Team = game.Teams.Lobby --Set team to Lobby end) end) end)
If this helped please accept my answer! Thanks!