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

How do I clone children from a table???

local Tools = script.Tools:GetChildren()
ToolC = Tools:Clone() -- This does not work, how do make the clone working???
TooC = Player.Backpack

The above is a quick script I wrote it is not fully completed but those who know how to script will understand this.

7 comments

0

lifjself is this botted tho

0

And stop spamming F5

0

This is somewhat helpful but I was wondering if I could clone it with the clone function.

0

No you can't. Table doesn't has :Clone() method, the method is only for Instance class.

0

Hmm okay, can you write that as a question so I can possibly turn this question as answered?

0

Answer*

1 answer

✓ Accepted answer

GetChildren returns a table. You have to iterate throughout the table and clone each individual one to the player.

for _, Tool in next, Tools:GetChildren() do
	Tool:Clone().Parent = Player.Backpack
end

1 comment

0

Thx, I knew of this but I suppose its the only way to cloning tables.

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