Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Make Your NPC Respawn On Death?

Asked by 3 years ago

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?

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. radiant_Light203 1166 — 3y
0
The NPC did respawn, however I had a moving and damage script attached to it. When it got cloned it stopped moving/attacking. ercleric 24 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.
Ad

Answer this question