Hello, I was wondering how I could detect when a player dies in my roblox game?
Thanks for helping,
ilovedevex
6 Likes
You can google this problem very easily before making a post about it.
15 Likes
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)
23 Likes
When I try this, after I die it doesn’t detect the death again, how would I fix that?
4 Likes
not sure what happened with you but I copied code and it worked the second time I die.
It only does it one time, because when you respawn you get a new Humanoid which isn’t the same.