Is it possible to clone values in a table at all? I tried simply using the :Clone() function, but it doesnt seem to support table values. So, does anyone happen to know a function with the capabilities of cloning values in a table? This is the table below in my script. Help is greatly appreciated! :)
local plr = game.Players.LocalPlayer local ShopTools = plr.Backpack:WaitForChild("BoughtTools"):GetChildren():Clone() table.foreach(ShopTools, function(i, v) v.Parent = plr.Backpack end)
I think I understand what you want. I may be wrong, please let me know if I am.
local plr = game.Players.LocalPlayer local ShopTools = plr.Backpack:WaitForChild("BoughtTools"):GetChildren() for i,v in pairs(ShopTools) do local clone = v:Clone() clone.Parent = plr.Backpack end
This will put any tools the player has inside of "BoughtTools" into the player's backpack.
for i,v in pairs() - This is a for loop that goes through a table you give it. i is the index, and v is the item it's on. I used the loop to go through every item, clone it, and set the clone's parent as the player's backpack.
Hope I helped. Let me know if I did :)