GamePassPrompt not working?

So I was working on this GamePassPrompt and for some reason it doesn’t work?

The script:
local MarketPlaceService = game:GetService(“GamePassService”)

local gamePassID = 19188539

local function promptPurchase()

local player = game.Players.LocalPlayer
local hasPass = false

local success, message = pcall(function()
    hasPass = MarketPlaceService:UserOwnsGamePassAsync(player.UserID, gamePassID)
end)

if hasPass == true then
    print("Player has pass")
else
    MarketPlaceService:PromptGamePassPurchase(player, gamePassID)
end

end

wait(5)
promptPurchase()

Help will be appreciated.

did you made the gamepass?
if it is this script will print Player Has Pass
because you made the gamepass , and you have it
can you test in the game and send a screenshot of your output?

Yes I made the GamePass and it does not print Player has pass.

1 Like

is this script all? if its not can you send the other lines?

There are no other lines in the script.

roblox is sensitive with this, change it to

player.UserId
1 Like

Do you own the gamepass you created?

change this
local MarketPlaceService = game:GetService(“GamePassService”)

to

local MarketPlaceService = game:GetService("MarketPlaceService”)

and also as Kaid3n22 said
change player.UserID
to
player.UserId

1 Like