Why is this "for i,v in pairs" script not working on Roblox servers, only in studio?
So first, i had table.foreach and then someone told me that it was not usable anymore. So i used the for i,vin pairs instead, as most people suggested, but it still doesnt seem to work. Can anyone please tell me what i should do to correct the script? Thanks!
The script is below.
1 | local plr = game.Players.LocalPlayer |
2 | local ShopTools = plr.Backpack:WaitForChild( "BoughtTools" ):GetChildren() |
3 | for i,v in pairs (ShopTools) do |
4 | local clone = v:Clone() |
5 | clone.Parent = plr.Backpack |