I want to change the player's team to Neutral after it dies. Here is the script, but it's not working.
local Players = game:GetService("Players") Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() if player.inGround.Value == true then player.Team = game.Teams.Neutral end end) end) end)
Please tell me what is the problem in this script. The 'inGround' value above was true when I tested this.