I want a model in the workspace to be removed only after it was destroyed. What currently happens is it continually respawns after a set amount of seconds and it doesn't wait for the model to be removed. Which is not my intent. Any help?
object = script.Parent
if (object ~= nil) and (object ~= game.Workspace) then
model = object
backup = model:clone() -- Make the backup
waitTime = 200 --Time to wait between regenerations
wait(waitTime)
while true do
wait(waitTime) -- Regen wait time
model:remove()
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
end
end

1 comment
I think you are cloning the model with the respawn script inside, which fires and creates another one, and so it goes.