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

How to copy parts that are inside a model?

Asked by 6 years ago

how?

i have a model that has parts in it, and i want to copy them, therefor copying the model's children (without copying the actual model itself) how

0
are there multiple parts you want to copy?? Skysenbajsen 0 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

I hope I understand your question but here is a basic script that will copy your model parts and set the parent of the copied parts to the workspace, just put the script inside a model and click run.

for i,v in pairs(script.Parent:GetChildren()) do
    local part = v:Clone()
    part.Parent = game.Workspace
end

Sincerely, -ViktorCorvinus

Ad
Log in to vote
0
Answered by 6 years ago

Based on my understanding of what you've said, you can do a loop that goes for every child inside the model and clone it. For example:

local parent = game.Workspace.Model -- Change to location of the model
local kid = parent:GetChildren()

for i=1, #kid do
    local clone = kid[i]:Clone()
    clone.Parent = game.Workspace -- Change to parent of the clone
end

This script will basically clone everything single part in the model, one by one, and put them into workspace.

Answer this question