I would need to use it to award the kill to the killer. Is there a specific triggered event, or will I have to script my own detector?
✓ ANSWER ACCEPTED
Is there an event that is triggered when a player dies?
1 answer
✓ Accepted answer
Yes, there's an event of Humanoids for when they die.
--LocalScript in StarterPlayer.StarterPlayerScripts
player = game.Players.LocalPlayer
repeat wait() until player.Character
character = player.Character
humanoid = character:WaitForChild("Humanoid")
humanoid.Died:connect(function() --Using the "Died" event of Humanoids
print("ded")
end)
Unfortunately you won't be able to know who killed him, only when he died. So no, you can't use this to directly award points to the killer. You'll have to figure something out.
This discussion is preserved as it was. New answers, comments, and votes are closed.
