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

How do I respawn models while still keeping the original model existing?

Asked by 3 years ago

I'm sorry if this is a stupid question, (i'm very new to coding) but is there any way to keep an original model from getting deleted because the new model has to spawn?

Here's the 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:remove() model = backup:clone() -- loads the backup of the model model.Parent = game.Workspace.Cars model:MakeJoints()()

end"

0
very hard to understand what you mean and the code is hard to read, you can use the blue circle button to format code. it seems like your doing model:Remove() which is destroying the model then your creating a new one replacing it, im not sure what you are trying to do enzotinman1 23 — 3y
0
can you be more specific? what game are you trying to do and what do you want to accomplish WINDOWS10XPRO 438 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
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

Ad

Answer this question