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

How do I make a script run After the player dies?

I have this script

game.Players.PlayerAdded:connect(function(player)
	while not player.Character do wait() end
	local character = player.Character
	local animateScript = character.Animate
	animateScript.idle.Animation1.AnimationId = 'http://www.roblox.com/asset/?id=277780651'
end)

When I join, it works. After I die, it completely stops working. How do I make it work After Death?

1 comment

0

game.Players.CharacterAdded instead. PlayerAdded is only when the player joins. CharacterAdded is when the character gets respawned or added

1 answer

A Theory For This Is...

The onDiedEvent, this occurs when the player dies, I believe that if you use a while true do loop, then whenever they die, you can insert the code to have it played. I have no idea on how this would look, but you should look up more info on the onDiedEvent here.

GreekGodOfMLG

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