Gamepass Click Detector doesnt work and says product is unavaliable

local CLICK_BLOCK = script.Parent

local ITEM_ID = 14983634

local Click = Instance.new(“ClickDetector”,CLICK_BLOCK)

Click.MouseClick:connect(function(p)

game:GetService(“MarketplaceService”):PromptPurchase(p,ITEM_ID)

end)
This script is suppose to give you a pruchase screen to purchase a gamepass but when you click on the brick, it tells me that the product is unavaliable despite it being avaliable. Can somebody help me?

1 Like

Put it in formatting. Checking now.

local CLICK_BLOCK = script.Parent

local ITEM_ID = 14983634

local Click = Instance.new("ClickDetector",CLICK_BLOCK)

Click.MouseClick:connect(function()

	game:GetService("MarketplaceService"):PromptPurchase(p,ITEM_ID)

end)

Quick question. Is Third Party Purchases turned on?

If not, you can turn it on here if you look on the right, you see game settings. Go there and go to Security. Then turn on third party purchases. Also, could you give a picture of the error if this doesn’t solve it?

You want to purchase a gamepass, correct? If so, use PromptGamePassPurchase instead.

I believe you meant (function(player)

local CLICK_BLOCK = script.Parent
local ITEM_ID = 14983634
local Click = Instance.new("ClickDetector",CLICK_BLOCK)

Click.MouseClick:connect(function(player)
	game:GetService("MarketplaceService"):PromptGamePassPurchase(player,ITEM_ID)
end)
2 Likes

Still doesnt work. Third Party Purchase is enabled.

Interesting. It seems to work for me. Can you give me a picture of the error?

I also edited your script so it’s this:

local CLICK_BLOCK = script.Parent

local ITEM_ID = 14983634

local Click = Instance.new("ClickDetector",CLICK_BLOCK)

Click.MouseClick:connect(function(p) --Changed here. (Added p)

	game:GetService("MarketplaceService"):PromptPurchase(p,ITEM_ID)

end)

Found the solution now. Thanks

I hope your game does well! Have a good day.