Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trying to clone an object into different parents?

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

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

1 comment

0

um


-- 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

This discussion is preserved as it was. New answers, comments, and votes are closed.