I'm trying to make an NPC respawn when it dies, but whenever I respawn

I’m trying to make an NPC respawn once killed.

When it respawns the NPCs’ scripts don’t work.
https://gyazo.com/99c38e07d91049d7e0246a2750b12a0a

I’ve looked at some posts but they don’t really help, I’ve also tried doing something along these lines:

NPC:WaitForChild("Script").Disabled = true
NPC:WaitForChild("Script").Disabled = false

Any help would be appreciated.

1 Like

To Respawn, I would suggest just destroying that NPC & cloning and placing a new one, from ServerStorage or something.

I’m already doing that, but all the scripts that allow the NPC to attack the humanoid just stop.

Do they have to be in ServerStorage? Or can I put them in ReplicatedStorage?

I usually use ServerStorage for storing Assets that are used by server mostly, and I believe you are cloning the NPC from Server Side? Also are there any errors or anything for debugging it & please post the scripts related to it, so we can debug more.

image

The stuff i crossed off isn’t relevant, these are the scripts.

Ah, I got it.
Clone the NPC, but don’t give it a parent.

local BackupNPC = NPC:Clone()

then

NPC.Died:connect(function()
BackupNPC.Parent = workspace

While you don’t assign a parent, the parent is nil, meaning that it won’t operate yet.

*NPC.Died - Well, find a way to determine when the first NPC is dead.

This is my current script, it basically does what you did there yet it doesn’t work.image