Hi, so I'm making a scanner, basically when you click a box it adds the item to your inventory and adds a label to the GUI, that's all working but I want to make it so that it can be removed.
So I've got this code snippet I've tried, I'll also attach an image of the explorer.
ScanAndGo.MainApplication.ProductsList.ChildAdded:Connect(function()
for i,Label in pairs(ScanAndGo.MainApplication.ProductsList:GetChildren()) do
if Label.Name ~= "ListLayout" then
Label.Remove.MouseButton1Click:Connect(function()
local Position = Label.Pos.Value
local Price = Label.Price.Value
table.remove(ProductTable,Position)
TransactionData.Total = TransactionData.Total - Price
icon1:setLabel("Total: "..Settings.Currency..string.format('%.2f', TransactionData.Total))
ScanAndGo.MainApplication.Total.Text = Settings.Currency..string.format('%.2f', TransactionData.Total)
showNotification("Neutral",Label.ProductName.Text .." removed from your basket.",1.5)
Label:Destroy()
end)
end
end
end)
I get an error in the output:
Players.jxdxn_14.Backpack.Phone.UI.LocalPhone:780: attempt to index function with 'MouseButton1Click'
This is a local script by the way, not sure if that matters
And here I'll attach a link to an image of the explorer ????
https://cdn.discordapp.com/attachments/785108506084507660/1036195550485299241/unknown.png
Let me know how I can fix it ????
thank u
