PromptProductPurchase working... kinda

I was trying prompt product purchase for the first time and I’ve came across an issue. Basically I have a set value in each button that has the id and in a local script I loop through the folder containing the buttons and do the PromptProductPurchase function with the value in the button. For some reason when I click it gives a prompt, but for the wrong gamepass. I’ve double checked all gamepass id’s and they are correct.

Like for example if I click the gamepass “2x Coins” it will prompt a completely unrelated purchase and says like “Short Shorts” and gamepass that’s worth like 12 robux will prompt

here is an example of how it works:

image

and here is the code:

local MPS = game:GetService("MarketplaceService")

local plr = game.Players.LocalPlayer

for i, v in pairs(GamepassIcons:GetDescendants()) do
	if v.Name == "BuyBtn" then
		v.MouseButton1Click:Connect(function()
			MPS:PromptProductPurchase(plr, v.ID.Value)
		end)
	end
end

Is 2x Coins a Gamepass or Product? If it’s a Gamepass, you are attempting to prompt a Product purchase instead of a Gamepass.

Try switching PromptProductPurchase with PromptGamePassPurchase and see if you still get that error.

local MPS = game:GetService("MarketplaceService")

local plr = game.Players.LocalPlayer

for i, v in pairs(GamepassIcons:GetDescendants()) do
	if v.Name == "BuyBtn" then
		v.MouseButton1Click:Connect(function()
			MPS:PromptGamePassPurchase(plr, v.ID.Value)
		end)
	end
end