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

Can a script in the workspace call out a tool from inside a player? - (CONTINUED)

Asked by 7 years ago
Edited by Shawnyg 7 years ago

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?

0
Formatted your code. Shawnyg 4330 — 7y
0
table.foreach is deprecated, use: "for i,v in pairs(ShopTools) do" instead RubenKan 3615 — 7y

Answer this question