Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I respawn a model without removing the original?

Asked by 3 years ago

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
0
this was answered already Xyternal 247 — 3y
0
Also, if I dont do model:MakeJoints()() instead of model:MakeJoints() the cars will start duplicating until it crashes. woodboiz 11 — 3y
0
check my answer. Xyternal 247 — 3y

1 answer

Log in to vote
0
Answered by
Xyternal 247 Moderation Voter
3 years ago
Edited 3 years ago

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
0
Thank you! woodboiz 11 — 3y
0
your weclome!!! Xyternal 247 — 3y
Ad

Answer this question