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

How to detect when the player dies on the Client side?

Asked by 5 years ago
Plr.Character:WaitForChild("Humanoid").Died:Connect(function()
    print("client side player has died")
end)

For some reason, this event only fires the first time the player dies, and doesn't work afterwards. I'm pretty sure this is because the instance Humanoid is still connected to the old previous character before the player died. Is there a way around this?

1 answer

Log in to vote
2
Answered by 5 years ago

When a roblox character dies, a new character is created. So there are different parts and other things like accessories, clothing etc. What you can do is either

A. Nest your died event listener in a CharacterAdded event listener.

B. Put the LocalScript into StarterCharacterScripts (this is a folder where scripts get cloned into the character).

Ad

Answer this question