Humanoid.Died will only fire one time

Okay, I am working on an Automorph script and everything works fine except for the Died event, it will fire one time and one time only.

My code:

game.Players.PlayerAdded:Connect(function(Player)
	Morph(Player)
	
	Player.Character.Humanoid.Died:Connect(function()
		Player.CharacterAdded:Wait()
		Morph(Player)
	end)

-- the actual morph function isn't important here as it works fine, its just this.
end)

First death screenshot:

Second death:

Can someone please help? thank you!

yeah… when a player dies, they tend to not exist again.

Joking aside, I’m pretty sure your script is getting deleted before it can actually run that morph command.
Where is the script located?

game.Players.PlayerAdded:Connect(function(Player)
    Player.Character.Added:Connect(function(Character)
        Character:FindFirstChildOfClass("Humanoid").Died:Connect(function()

        end)
    end)
end)

this way should work better

Try this instead:

game.Players.PlayerAdded:Connect(function(Player)
	Morph(Player)
	
	Player.CharacterAdded:Connect(function()
		Morph(Player)
	end)

-- the actual morph function isn't important here as it works fine, its just this.
end)

It is in the ServerScriptService

mr @D0RYU and mr @ItsSovxy just answered your question :sunglasses:

Bascially when a player dies their character resets, so its set to nil and its reloaded with a new one.

Oh, well that explains this, thank you.

I had to fix a small error in my code, lmao

shh we don’t talk about that :eyes:

1 Like