This script was used for my team change when dead.
game.Players.PlayerAdded:connect(function(plr) plr.Neutral = false plr.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() if plr.TeamColor == BrickColor.new("Bright red") then plr.TeamColor = BrickColor.new("Bright Blue") else plr.TeamColor = BrickColor.new("Bright red") end end) end) end)
The problem is, whenever you die. It creates a new team called "Neutral" when they die. Does anyone know the problem?
Team1 = game.Teams.Red Team2= game.Teams.Blue game.Players.PlayerAdded:connect(function(plr) plr.Neutral = false plr.CharacterAdded:connect(function(character) plr.Neutral = false character:WaitForChild("Humanoid").Died:connect(function() if plr.TeamColor == Team1 .TeamColor then plr.TeamColor = Team2.TeamColor else plr.TeamColor = Team1.TeamColor end end) end) end)
everytime player spawns set there Neutral
edit: if team Dosent exist then it will be set to Neutral
If code dosent work COmment below