I am having issues with this simple zombie respawn script.
Does anyone know anyway of making it more efficient less laggy?
Because I have so many npcs in a map, it causes lag spikes every 10 seconds. (As it has to run this script for each NPC).
For the NPCs I have a model called NPCs then another model inside of it called NPCs with all the npcs inside of it. So far this script has to be placed into each individual npc. Could there also be a way to have the scirpt auto put it's self into an npc if it's humanoid.health < 1 ?
thanks, script:
name = "Humanoid"
robo = script.Parent:clone()
while wait(10) do
if script.Parent.Humanoid.Health < 1 then
wait(35)
robot = robo:Clone()
robot.Parent = script.Parent.Parent
robot:MakeJoints()
script.Parent:Remove()
break
end
end |