Sorry if it's a dumb question, but i'm still pretty new to the whole coding thing, and I thought I would get some more experienced opinions. I'm looking to have this script regenerate an npc if a certain amount of time passes, and the npc has full health.
The NPC is respawning, regardless of how much health he has, including full health.
I might just be a bingus, but thank you for taking the time to help me out!
object = script.Parent if (object ~= nil) and (object ~= game.Workspace)and script.Parent.Humanoid.Health >= script.Parent.Humanoid.MaxHealth then model = object else end backup = model:clone() waitTime = math.random(3,15) wait(math.random(0, waitTime)) while true do wait(waitTime) model:remove() model = backup:clone() model.Parent = game.Workspace model:makeJoints() end