Humanoid.Died() not working

I am trying to create death scene, but its not detecting when player dies. can anyone tell me why?

local player = game.Playes.LocalPlayer;

local Character = player.Character
local Humanoid
if Character then
	Humanoid = Character:FindFirstChild("Humanoid")
end

respawn = 1;
print(Humanoid);
Humanoid.Died:Connect(function()
	script.Parent.Frame.Visible = true;
	while respawn < 10 do
		wait(1);
		respawn += 1;
	end
	script.Parent.Frame.Visible = false;
end)
1 Like

Did you disable ResetOnRespawn ?

1 Like

Hey man. Maybe change this line from this:

local Character = player.Character
local Humanoid
if Character then
	Humanoid = Character:FindFirstChild("Humanoid")
end

To this?

local Character = player.Character or player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

Also, is your script a LocalScript?

1 Like

Yes its is localscript! will it cause problems?

hey man, your line 1 is game.PLAYES not PLAYERS you’re missing an r

No it will not cause any problems.
Have you tried the solution I came up wi the up above?

Also maybe try putting the LocalScript inside of StarterPlayerScripts.

Still doesnt work. any more ideas???

does anything print out at all from the prints you have?

@GMAL222
Hello, this script works and detects when the player dies:

local char = game.Players.LocalPlayer.Character
local hum = char:WaitForChild("Humanoid")
print(char, hum)

hum.Died:Connect(function()
	
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.