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

How do I clone children from a table???

Asked by 3 years ago
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.

0
lifjself is this botted tho HappyRobloxFish 22 — 3y
0
And stop spamming F5 Block_manvn 395 — 3y
0
This is somewhat helpful but I was wondering if I could clone it with the clone function. THUNDER_WOW 203 — 3y
View all comments (3 more)
0
No you can't. Table doesn't has :Clone() method, the method is only for Instance class. Block_manvn 395 — 3y
0
Hmm okay, can you write that as a question so I can possibly turn this question as answered? THUNDER_WOW 203 — 3y
0
Answer* THUNDER_WOW 203 — 3y

1 answer

Log in to vote
2
Answered by 3 years ago

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
0
Thx, I knew of this but I suppose its the only way to cloning tables. THUNDER_WOW 203 — 3y
Ad

Answer this question