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 11 years ago
1for i, v in pairs(game.Players:GetChildren()) do
2    v.Character.Humanoid.Died:connect(function()
3        v.TeamColor = BrickColor.new("Institutional white")
4    end)
5end

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 11 years ago
1game:GetService('Players').PlayerAdded:connect(function(player)
2    player.CharacterAdded:connect(function(character)
3        character:WaitForChild("Humanoid").Died:connect(function()
4            game.Players:findFirstChild(character.Name).TeamColor = BrickColor.new("Institutional white")
5        end)
6    end)
7end)
0
Thanks :D NinjoOnline 1146 — 11y
Ad
Log in to vote
0
Answered by 11 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