Humanoid.died not working in localscript?

Hey so I need a remote to fire when a player dies unfortunately that isnt working, heres what I tried.

game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
	char.Humanoid.Died:Connect(function()
		print("Player died")
	end)
end)

Where is the script located in the explorer?

game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
	char:WaitForChild("Humanoid").Died:Connect(function()
		print("Player died")
	end)
end)
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

humanoid.Died:Connect(function()
	print("Died!")
end)

Is how you’d achieve this in a local script.

Not the issue, its not firing at all.

Humanoid gets destroyed when it dies. You need to put the CharacterAdded part into a function, like this:

local PlayersService = game:GetService(“Players”)
local LocalPlayer = PlayersService.LocalPlayer

LocalPlayer.CharacterAdded:Connect(function()

        LocalPlayer:WaitForChild(“Humanioid”).Died:Connect(function()
                 print(LocalPlayer, “Has died!”)
       end)
end)
1 Like