How can I make a function that plays once in a for loop?

I am making a backpack system for my game, I am new to GUI so this is kind of different for me. In the local script below I try to give each item in the players inventory a frame if that item exists and allow the player to drop the item on the ground which will make the text value in the backpack for that item decrease. Everything works except for the last part, which is making the items text value decrease. Rather than decreasing once for every time the player right clicks the image button it decreases for as many items that are in my bag for that item type. What I find strange is that this system only drops one item from backpack into workspace yet decreases the value for as many items there is in the same loop? What I need help with is finding some sort of way to make a function that will only run once in the for loop for every time the player right clicks the image button. I have already tried a debounce but I might be doing it wrong. Do let me know if you have any ideas thanks.

GOAL = Decrease Item.Value once for every time the player right clicks the item.
Local Script:

wait(3)

local plerr = game.Players.LocalPlayer
local charac = plerr.Character
local HumanoidRoot = charac:WaitForChild("HumanoidRootPart")
local PlayerInventory = plerr["Player Inventory"]


local MainGUI = script.Parent
local InventoryGUI = MainGUI.ItemHolder
local ItemFrames = InventoryGUI:GetChildren()


for i, Item in pairs(PlayerInventory:GetChildren()) do
	Item.Changed:Connect(function()
		print("IS")
		local ItemInBagValue = InventoryGUI.ItemOrder:WaitForChild(Item.Name)
		if ItemInBagValue then
			print("IN THE BAG")
			ItemInBagValue.ItemQuantity.Text = Item.Value
			ItemInBagValue.ItemImage.Image = Item:FindFirstChild("ItemImage").Texture
		end
		script.Parent.ItemHolder["ItemTemplate"].ItemBorder.ItemQuantity.Text = Item.Value
			if ItemInBagValue.ItemImage then
				ItemInBagValue.ItemImage.MouseButton2Up:Connect(function()
					if Item.Value <= 0 then
						return
					end
					local MoveItem = nil
				  	if Item.Name == "Tool" then
						MoveItem = plerr.Backpack:FindFirstChild("Food")
					elseif Item.Name == "Food" then
						MoveItem = plerr.Backpack:FindFirstChild("Tool")
					end
					wait(0.1)
					Item.Value -= 1
					ItemInBagValue.ItemQuantity.Text = Item.Value
					MoveItem.Parent = game.Workspace
					MoveItem.RHolder.CFrame = HumanoidRoot.CFrame + HumanoidRoot.CFrame.LookVector * 3.5 + Vector3.new(0, 2, 0)
					plerr.DropItem.Value = true
				end)
		end
	end)
end