Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make a script where a script will run when the player dies?

How can I make a script where a script will run when the player dies? ex: when that player dies a script will run or just print(yes)

maybe like an OnDiedScript or something Like that.

1 comment

0

humanoid.Died event listener in the script you want to run

2 answers

✓ Accepted answer

A more polished version of the answer above me. (Assuming you've allready set a "Player" value.)


local Humanoid = Player.Character:WaitForChild("Humanoid")

Humanoid.Died:Connect(function()
print(Humanoid.Parent.Name  ..  " has died.")
end)




game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function() this will run once the local player has died

1 comment

0

where do I put the script?

This discussion is preserved as it was. New answers, comments, and votes are closed.