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

How would I make a part of a script run when a player dies?

Asked by 10 years ago

I would like a message (already made) to show text when a player is killed. How would I do this?

2 answers

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
game.Players.PlayerAdded:connect(function(plr)
plr.Character.Humanoid.Died:connect(function()
-- Code
end)
end)
Ad
Log in to vote
0
Answered by 10 years ago

First, disable the script.

a = game.Players:FindFirstChild() a.Name = ("Humanoid") if Humanoid.Health = 0 then script.(--Where ever your script is located).script.Disabled = false end

This is a guess, sorry if it doesn't work, but it might. You are looking to run the script when a player has died. So you have to find the first child in Players and enable the script if the players health is 0.

Answer this question