Why isn't my gamepass script working?

I was creating my games, and when I was testing my GUI’s, my gamepass button did not operate the script. I went back to the output, and it said "PromptGamepassPurchase is not a valid member of MarketplaceService “MarketplaceService”.

I don’t know how to fix this problem, since I got help with this script, and I am a complete novice at scripting.

Here is the script:

local gamepass_id = 1

script.Parent.MouseButton1Click:Connect(function()
game:GetService(“MarketplaceService”):PromptGamepassPurchase(game.Players.LocalPlayer, gamepass_id)
end)

I would like help on this.

1 Like

should be PromptGamePassPurchase, with a capital P in pass: MarketplaceService | Documentation - Roblox Creator Hub

1 Like