Why isn't my gamepass working?

Hi there, so I am trying to make an admin gamepass, but when I try to test purchase it, it says this item isn’t currently for sale, even though it is?

My script is:

local productId = 12355653
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
Game:GetService(“MarketplaceService”):PromptPurchase(player, productId)
end)

Take a look at this. Since you are prompting a gamepass purchase, you should use PromptGamePassPurchase.

I’m a builder so I followed a tutorial to do this. What do you mean I should use PromtGamePassPurchase? As in insert that somewhere?

Replace PromptPurchase with PromptGamePassPurchase. PromptPurchase is a request to buy any single asset from the library (Game passes don’t appear in the library) and PromptGamePassPurchase is a request to purchase a game pass.

Try using this code :

local productId = 12355653
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
end)

Ah thank god, it finally worked. I appreciate your help very much!

2 Likes