PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Died

This event fires when the Humanoid dies, usually when Humanoid/Health reaches 0. This could be caused either by disconnecting their head from their Humanoid/Torso, or directly setting the health property.

This event only fires if the Humanoid is a descendant of the Workspace. If the Dead Enum/HumanoidStateType is disabled it will not fire.


Code Samples


Humanoid.Died

The code below would print the player’s name, followed by “has died!”, whenever a player dies. For example, if the player was named “Shedletsky”, “Shedletsky has died!” would be printed to the output when they 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)