#how do i add a npc respawn script
69 messages · Page 1 of 1 (latest)
could you put that into a script? if thats possible
to clone the npc and from there and stuff
Me giving you a script doesn’t help your learning,but I can give you the individual steps for you to google if you don’t know how to
id rather have the script rn just to get it over with, im planning to learn lua later on
- Put a script inside the npc. Inside the script, do:
local Clone = script.Parent:Clone()
Clone.Parent = game.ServerStorage
- 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)
thanks bro
also i have another question
my npc wont take damage from guns like smg pack from roblox
dont know why
Idk then sorry
thats fine, thank you
Use multi client and check if you can dmg players with the bullet
ok, give me like 10 mins I’m doing other things
I'm already planning to sleep lol so maybe a more experienced guy will help you
I don’t think anyone experienced will really respond to this post
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
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?
ServerStorage does not exist
use ReplicatedStorage
local Clone = script.Parent:Clone()
Clone.Parent = game.ReplicatedStorage
Is that correct?
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
** You are now Level 4! **
So npcs and players
It’s better to have a copy in there over moving one in
Probably can’t detect humanoids
Does it work for multiple npcs in replicated storage?
Or just one cause I’m not sure
How do you think I could fix it? Any solution?
Depends, are they from toolbox or did you make them?
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
tried again with replicated storage, it doesnt work either
dont know why i think ive done everything correct for it
Are you using :Clone()
yeah
am i supposed to type the name of the zombie there?
idk
Show your current script please
sorry, I was doing stuff. Ill send it to you in a min, loading up studio
why does script.parent get destroyed?
If a humanoid died then there’s no need for that
i was told to put that, what do i replace it with?
Just remove it. Humanoid.Died should delete the character
So why delete it if it already gets deleted
do i put the name of my npc in Clone:()
?