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

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

Asked by 4 years ago

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.

0
humanoid.Died event listener in the script you want to run DeceptiveCaster 3761 — 4y

2 answers

Log in to vote
2
Answered by 4 years ago

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)
Ad
Log in to vote
0
Answered by 4 years ago

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

0
where do I put the script? EnchMusic 26 — 4y

Answer this question