I'm simply wondering how to check if a player has a game pass and if not prompt a purchase. I tried making my own script, although I am not sure why it isn't working. Help would be very much appreciated!
wantedtrail = nil
script.Parent.MouseButton1Click:Connect(function()
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, 5794064) then
wantedtrail = "RedTrail"
workspace.Events.Trail:FireServer(wantedtrail)
else
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 5794064)
end
end)

4 comments
Gamepasses are no longer assets, use "game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player.userId, 5794064)" instead
If it's a real old gamepass, make sure you have the correct # for it from it's URL
I fixed that obvious mistake (argh) Still doesn't seem to work though?
answered