Gamepass saying "This item is not for sale" although the "Item for sale" option is already turned on

Hello, I’m pretty new to scripting and I’m trying to make a GUI that brings up the gamepass menu when you click it.
I have turned on the “Item for sale” option but it still says “This item is not for sale” in-game
I don’t know what is the problem here.

Here is the code:
local gamePassID = 8521513

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()

game:GetService(“MarketplaceService”):PromptPurchase(player,gamePassID)

end)
And this is the game: Test - Roblox

7 Likes

Have you tried using :PromptGamePassPurchase(player, gamePassID) instead of :PromptPurchase(player,gamePassID)?

12 Likes

Yeah, along with what rokec123 was saying, I believe (not 100% sure) :PromptPurcahse is for developer products and can easily be mismatched with products along Roblox.

1 Like

You’re thinking of PromptProductPurchase. PromptPurchase is for any asset.

3 Likes

Just to explain something here: game passes use a separate id system, which PromptGamePassPurchase respects (it prompts a purchase from the game pass id system). When you use PromptPurchase, it fetches from the main id stream which the asset associated with that id is an offsale t-shirt, hence attempting to prompt an offsale asset.