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

How to detect when a players humanoid died?

Hello I am having trouble, I'm trying to detect when a players humanoid died, but I don't know how, can someone help me please? Thanks! :D

1 answer

✓ Accepted answer

Use the Died Event. Here's an example:-

-- This script makes a message in the server when a player dies, like if I died then a message will appear saying "kudorey619 has died!"
game:GetService('Players').PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid").Died:connect(function()
			print(player.Name.."has died!")
		end
	end
end

For more information: http://wiki.roblox.com/index.php/Died_(Event)

2 comments

1

Small note though. I'm not sure if ROBLOX has fixed this recently, but as of the last time I checked, the Humanoid.Died event doesn't work. The best work around I've seen is a while loop that checks if the player's health reaches 0. (basically a manual Died event)

1

Thanks for the information!

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