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

How to check if a player has died?

Asked by 10 years ago
for i, v in pairs(game.Players:GetChildren()) do
    v.Character.Humanoid.Died:connect(function()
        v.TeamColor = BrickColor.new("Institutional white")
    end)
end

Why isn't this working? I want when a player dies, it take you to lobby.

2 answers

Log in to vote
1
Answered by 10 years ago
game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
            game.Players:findFirstChild(character.Name).TeamColor = BrickColor.new("Institutional white")
        end)
    end)
end)
0
Thanks :D NinjoOnline 1146 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

this is simple... you just have to set the 'Auto Assignable' to false in the Spawn Part so that you can make a selectable spawn...

Answer this question