Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make model respawn only after it was destroyed?

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

0

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

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.