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

How can I get the player to switch teams on death?

Asked by 5 years ago

I already tried this code:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid").Died:Connect(function()
            if player.TeamColor == ("New Yeller") then
                player.TeamColor = BrickColor.new("Brown")
            end
end
end

but it isn't working for some reason.

0
(line 4) because the teamcolor property isnt a string theking48989987 2147 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

There Is An Error On Line 4. It Should Be:

if player.TeamColor == BrickColor.new("New Yeller") then
Ad

Answer this question