How should I detect when a player dies?

Hello, I was wondering how I could detect when a player dies in my roblox game?
Thanks for helping,
ilovedevex

6 Likes

https://developer.roblox.com/en-us/api-reference/event/Humanoid/Died

You can google this problem very easily before making a post about it.

12 Likes

https://developer.roblox.com/en-us/api-reference/event/Humanoid/Died

3 Likes
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)
19 Likes

When I try this, after I die it doesn’t detect the death again, how would I fix that?

1 Like

not sure what happened with you but I copied code and it worked the second time I die.