I would like a message (already made) to show text when a player is killed. How would I do this?
COMMUNITY QUESTION
How would I make a part of a script run when a player dies?
2 answers
game.Players.PlayerAdded:connect(function(plr)
plr.Character.Humanoid.Died:connect(function()
-- Code
end)
end)
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
