Wouldn't roblox gamepass tutorial always be false?
I was testing the gamepass tutorial which is here: and I have realized that their script will always have haspass as false, is there a way to fix? I tested in studio and server within studio
Localscript:
02 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
03 | local Players = game:GetService( "Players" ) |
05 | local gamePassID = 5143841 |
08 | local function promptPurchase() |
10 | local player = Players.LocalPlayer |
13 | local success, message = pcall ( function () |
14 | hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID) |
18 | warn( "Error while checking if player has pass: " .. tostring (message)) |
22 | if hasPass = = true then |
23 | print (player.. "already owns gamepass" ) |
27 | MarketplaceService:PromptGamePassPurchase(player, gamePassID) |
31 | script.Parent.MouseButton 1 Down:connect(promptPurchase) |
Script::
01 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
03 | local gamePassID = 5143841 |
06 | local function onPromptGamePassPurchaseFinished(player, purchasedPassID, purchaseSuccess) |
08 | if purchaseSuccess = = true and purchasedPassID = = gamePassID then |
09 | print (player.Name .. " purchased the game pass with ID " .. gamePassID) |
10 | local Boombox = game.ServerStorage:FindFirstChild( "BoomBox" ) |
11 | Boombox:Clone().Parent = player.Backpack |
16 | MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished) |
Output:
false
,
SilviaTheros911 purchased the game pass with ID 5143841
,
false
SilviaTheros911 purchased the game pass with ID 5143841
,
false