for i,v in pairs(game.Players.LocalPlayer:WaitForChild("Inventory"):GetChildren()) do if game.Players.LocalPlayer.Inventory:FindFirstChild(v) ~= nil then game.Players.LocalPlayer.Inventory[v]:Clone().Parent = script.Parent end end
I get no errors at all but it doesn't load the players items into the GUI.
Use local script and you can create a variable for player, not use game.Players.LocalPlayer.Inventory[v]:Clone().Parent = script.Parent
the correct is v:Clone().Parent = script.Parent
Try it:
repeat wait() until game.Players.LocalPlayer local plr = game:GetService("Players").LocalPlayer local inv = plr:FindFirstChild("Inventory") for i,v in pairs(inv:GetChildren()) do if v ~= nil then v:Clone().Parent = script.Parent end end