Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(SOLVED)Why doesn't this player team change script works?

Asked by 5 years ago
Edited 5 years ago

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.

0
I do not use Teams but all code I have seen swaps teams by setting the BrickColour for the given team User#5423 17 — 5y
0
also == true is redundant User#5423 17 — 5y
0
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? StrategicPlayZ 58 — 5y
0
Oh don't worry I managed to get it to work! I removed the ==true statement and it worked fine! StrategicPlayZ 58 — 5y
0
write solved in the title tonyv537 95 — 5y

Answer this question