Getting error. Anyone can help with that? Here a script
local object = game.ReplicatedStorage.Items script.Parent.Parent.Inventory.MouseButton1Down:connect(function(control) for i, child in pairs(object:GetChildren()) do for i, child1 in pairs(child:GetChildren()) do local itemid = child1:FindFirstChild("ItemId") --added quotes to name if itemid then warn(itemid.Value) end end end end)
I think your only problem is you are missing some quotes. If that still doesn't work, double-check to see if name actually exists. Consider printing out stuff like the child1 table. Printing out stuff is a great way to debug!
local open = true local object = game.ReplicatedStorage.Items local name = "ItemId" script.Parent.Parent.Inventory.MouseButton1Down:connect(function(control) if open == true then open = false script.Parent.Parent.InventoryGui.Visible = true for i, child in pairs(object:GetChildren()) do for i, child1 in pairs(child:GetChildren()) do local child2 = child1:FindFirstChild("name") --added quotes to name warn(child2.Value) end end else open = true script.Parent.Parent.InventoryGui.Visible = false end end)