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.

5 comments
I do not use Teams but all code I have seen swaps teams by setting the BrickColour for the given team
also == true is redundant
I have tried swapping the team with the TeamColor but it doesn't work too! Can you help me find what is the problem here?
Oh don't worry I managed to get it to work! I removed the ==true statement and it worked fine!
write solved in the title