How do i make a Humanoid.Died Script?

Ok so im finishing my little project and i want to add so when you die it tps you to
the beginning and you dont have to rejoin to have another try
robloxapp-20230111-1748041.wmv (2.8 MB)
i dont know how to make a script that executes when you die, thats all i need, ive tried some methods but i dont wanna risk it, i want to understand it before doing anything

do you guys know how to?

I agree with @2jammers, the solution is literally in the title

Character.Humanoid.Died:Connect(function() -- that simple
    -- code
end)

You actually want to do

player.CharacterAdded:Connect(function()

end)

Humanoid.Died doesnt do anything to the character that respawns.

He said he wants to do something when the humanoid “dies”. Please read the topic.

1 Like

You cant modify the character after it dies. Humanoid.Died fires after the character dies.

How is this Relevant to the Topic?

They are asking how to detect if a Player Dies?

(nvm, i see what you mean)

Its relevant because your character is dead. When your humanoid reaches the dead state you cant do anything to it… because its dead, and the player.Character will be referenced to a new Character model. So you’d be modifying an old useless character Model with Humanoid.Died. Thats why you want to use character added.

@Alonso_lel wants to move a character after it dies assuming it can still be used, a dead humanoid cant be used.

Yes it can, it can be used until it no longer exists (Destroying / Removing) while yes, the player cant do anything, doesn’t mean it cant be used.

While you are asking how to do this, Its a bit weird that you know what function to use, but you are asking what to do, and how to use it?

Thats a but odd…

I’m Confused on what you mean, When you respawn, wont you spawn back at the Beginning?

If you want an instant Respawn, you can either set the Players RespawnTime to a really low number, or you can use Player:LoadCharacter() which Loads in the Character almost Instantly.

Solution is in your Title.

Why? What’s it going to do to you?

Code fires when you die, and you Respawn?

1 Like

Code executes when you die, to be more specific i want a part to replace another when you die, like the exact moment you die, yeah ik its dumb but like idk how to make a Humanoid.Died Script, ive seen users using fuctions, others using get service, i just idk, i havent used this before.

theres a lot of confusion here, so lemme make this clear, i want this script to be on server script service, cuz i want to apply a script on a part when the humanoid dies and not in the player itself.

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