Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How To Make Your NPC Respawn On Death?

I'm currently attempting to create an NPC that respawns, the NPC I am using is from the "Build Rigs" plugin. The NPC is R6. A following question is, would this be a better script for an NPC to have, or should I create a spawning plate instead that detects if said NPC is dead?

2 comments

0

It's pretty simple. Clone the NPC, listen/wait for the Humanoid.Died event and move the clone to workspace while deleting the dead NPC.

0

The NPC did respawn, however I had a moving and damage script attached to it. When it got cloned it stopped moving/attacking.

1 answer

✓ Accepted answer

So, radiant_light203 told you how to solve this problem, but you said you had a moving and damage script attached to the npc. Simply, don`t attach scripts to the NPC, use other services like serverscriptservice and put there the script, after you did that simply make a variable with the NPC like

local npc = game.Workspace.Folder.NPCNAME -- [or whatever, or waitforchild].
-- and then you continue the scripting, don`t attach to the npc because there will appear bugs.

This discussion is preserved as it was. New answers, comments, and votes are closed.