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

Trying to clone an object into different parents?

Asked by 6 years ago

So i'm trying to clone something into multiple parents and it seems to work but when it clones it never stops so it just keeps cloning into the parents, why?

local clone = script.Parent.OfferTrade:Clone()



for i, v in pairs(script.Parent.Parent.Frame:GetChildren()) do
        clone:clone().Parent = v
    end

2 answers

Log in to vote
0
Answered by 6 years ago

try this

local clone = script.Parent.OfferTrade:Clone()



for i, v in pairs(script.Parent.Parent.Frame:GetChildren()) do
        clone:clone().Parent = v
  script.parnt:remove()
    end

or if you want

local clone = script.Parent.OfferTrade:Clone()



for i, v in pairs(script.Parent.Parent.Frame:GetChildren()) do
        clone:clone().Parent = v
   wait(999999999999999999999999) -- change the number to how much you want wait to work again
    end
0
um greybird700 63 — 6y
Ad
Log in to vote
0
Answered by
sad_eyez 162
6 years ago
Edited 6 years ago

-- It's always good to use WaitForChild local thing= script.Parent:WaitForChild("OfferTrade") local frame = script.Parent.Parent:WaitForChild("Frame") for i, v in pairs(frame:GetChildren()) do local clone = thing:Clone() clone.Parent = v --Parents the clone wait(0.2) -- Acts as a sort of debounce, to prevent it from going to fast end

Hope this helps :D

Answer this question