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

How do I respawn a model without removing the original?

I am trying to make the script that Down Hill Smash uses to make cars spawn, and I got it working but the original cars disappear when the new cars spawn, making the cars just disappear.

Any idea's to fix this? (below is code)

model = game.Workspace.Cars.RedCar1 
backup = model:clone() -- backs up the model so it can respawn
while true do 
wait(7) -- regenerates the model after 7 seconds 
model:destroy() 
model = backup:clone() -- loads the backup of the model 
backup = model:clone() -- backs up the model so it can respawn
model.Parent = game.Workspace.Cars 
model:MakeJoints()
end

3 comments

0

this was answered already

0

Also, if I dont do model:MakeJoints()() instead of model:MakeJoints() the cars will start duplicating until it crashes.

0

check my answer.

1 answer

✓ Accepted answer

So here is your problem. You've mixed your script a bit. Here's how it should be

model = game.Workspace.Cars.RedCar1 
backup = model:clone() -- backs up the model so it can respawn
while true do 
wait(7) -- regenerates the model after 7 seconds 

model = backup:clone() -- loads the backup of the model 

model.Parent = game.Workspace
model:MoveTo(x,y,z)
end

2 comments

0

Thank you!

0

your weclome!!!

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