#how do i add a npc respawn script

69 messages · Page 1 of 1 (latest)

abstract quiver
#

Put a copy of it anywhere that isn’t workspace(recommend ServerStorage or ReplicatedStorage) then detect when it has died and clone the npc from the storage to the workspace

celest flume
#

to clone the npc and from there and stuff

abstract quiver
celest flume
abstract quiver
#
  1. Put a script inside the npc. Inside the script, do:
    local Clone = script.Parent:Clone()
    Clone.Parent = game.ServerStorage
#
  1. In the same script, do:
    script.Parent.Humanoid.Died:Connect(function()
    local respawn = Clone:Clone()
    wait(<put your time to respawn here>)
    script.Parent:Destroy()
    respawn.Parent = workspace
    end)
celest flume
#

thanks bro

#

also i have another question

#

my npc wont take damage from guns like smg pack from roblox

#

dont know why

abstract quiver
#

Weird

#

Does it have infinite health?

#

Or is it just a normal Roblox rig

celest flume
#

its a zombie model with actual hp

#

linked sword works on it

#

guns dont

abstract quiver
#

Idk then sorry

celest flume
#

thats fine, thank you

summer goblet
celest flume
summer goblet
celest flume
#

That’s fine tho

#

and also

#

i just finished testing

#

i cant damage players

#

with the gun

#

so what does not being able to damage players with the smg do

digital void
#

Hallo

#

Is it just the npc

#

I suspect the gun has some friendly fire shit

#

And it checks for teams

#

And npcs u know don't belong to any teams

#

Are there any errors?

wind umbra
#

use ReplicatedStorage

celest flume
#

Is that correct?

celest flume
# digital void Is it just the npc

I can’t damage other players with it, which that’s what I want since I don’t want others to attack each other however I can’t damage npcs either

sharp edgeBOT
#

studio** You are now Level 4! **studio

celest flume
#

So npcs and players

real veldt
celest flume
#

Or just one cause I’m not sure

celest flume
real veldt
#

Depends, are they from toolbox or did you make them?

celest flume
#

toolbox

#

It’s a zombie with a pathfinder, I just changed the look of the zombie and other things for my own purpose

#

don’t know what to do for it ngl

celest flume
#

dont know why i think ive done everything correct for it

real veldt
celest flume
#

am i supposed to type the name of the zombie there?

#

idk

real veldt
#

Show your current script please

celest flume
celest flume
real veldt
#

why does script.parent get destroyed?

#

If a humanoid died then there’s no need for that

celest flume
real veldt
#

Just remove it. Humanoid.Died should delete the character

#

So why delete it if it already gets deleted

celest flume
#

?

real veldt
#

No

#

Clone has no parameters