Humanoid.Died , doesn't work?

game:GetService('Players').PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
			
			
			print(player.Name.. " has died!") -- this isn't printing
			
			
			
		end)
	end)
end)

Why does this not work? Its code taken straight from here: Humanoid.Died

Roblox studio glitch maybe?

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

humanoid.Died:Connect(function()
	print(player.Name.." has died!")
end)

I’m assuming this is a local script. PlayerAdded won’t fire since the local player instance has already loaded on the client’s side before the script executes.

1 Like