How to clone all parts under a model with a wait time in between each?

  1. What do you want to achieve? I want to clone all parts of a model but with a delay in between each item. So they will appear in destination with a split second in between each.

  2. What is the issue? Using a i,v in pairs loop clones all children at same moment.

  3. What solutions have you tried so far? Ive tried searching and adding wait in different variations.

I know one method is to reference each part and clone them with a wait in between. But if there is alot of parts inside a model is there a way to loop through all and clone 1 at a time that way?

for i,v in pairs (model:GetChildren()) do
If v:IsA("BasePart") then
local Part = v:Clone()
Part.Parent = WorkSpace
Etc.
end

No, its not doing that, its one by one very quickly.

Just add a tast.wait(1) at the end of the loop

for i,v in pairs (model:GetChildren()) do
If v:IsA("BasePart") then
local Part = v:Clone()
Part.Parent = WorkSpace
task.wait(1)
end
1 Like

This worked perfectly, Thank you. Additional question. By any chance is it possible to make it start with bigger part 1st then move on to smaller ones?

To do that, I think you could firstly iterate all parts and based on its size magnitude, store it into an ordered table. Then iterate that ordered table to make them “spawn/clone/show”

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.