HELP ME i dont understand why doesnt work

help i make a pick up and inventory sistem but my drop system broken why help me please
the outpout say me parent is not a valid member of Part “Branche”

for i, itemButton in pairs(InventoryGui.ItemList:GetDescendants()) do
if itemButton:IsA(“ImageButton”) then
itemButton.MouseButton2Up:Connect(function()
local itemFrame = itemButton.parent
local itemValue = Inventory:FindFirstChild(itemFrame.Name)
if itemValue.Value > 0 then
local DropItem = DropItem:InvokeServer(itemFrame.Name)
if DropItem == true then
if itemValue.Value > 0 then
itemFrame.ItemQuantity.Text = itemValue.Value
else
itemFrame.Visible = false
end
end
end
end)
end
end

Parent needs to be capitalized.

2 Likes

dont work please help me more idk why dont work im make that help more

for i, itemButton in pairs(InventoryGui.ItemList:GetDescendants()) do
if itemButton:IsA(“ImageButton”) then
itemButton.MouseButton2Up:Connect(function()
local itemFrame = itemButton.Parent
local itemValue = Inventory:FindFirstChild(itemFrame.Name)
if itemValue.Value > 0 then
local DropItem = DropItem:InvokeServer(itemFrame.Name)
if DropItem == true then
if itemValue.Value > 0 then
itemFrame.ItemQuantity.Text = itemValue.Value
else
itemFrame.Visible = false
end
end
end
end)
end
end

the output say me the same things