Thanks so much AlreadyPro for the script! So the script works completely fine, but one problem. The output gives me an error when the :Clone() function is called, as you can see on line 2 of the script below.


local plr = game.Players.LocalPlayer
local ShopTools = plr.Backpack:WaitForChild("BoughtTools"):GetChildren():Clone()
table.foreach(ShopTools, function(i, v)
	v.Parent = plr.Backpack
end)

it gives me this error: Workspace.GameScript:67: attempt to call method 'Clone' (a nil value)" Would anyone know how to fix this error?

2 comments

0

Formatted your code.

0

table.foreach is deprecated, use: "for i,v in pairs(ShopTools) do" instead