Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Game Pass promptPurchase not showing thumbnail?

Asked by 6 years ago

Hi!

My Game Passes work and are possible to be bought, but when the 'are you sure' window pops up, no thumbnail is being shown. I have looked on the web for this problem, but no luck so far. I saw that it is/was a known bug, but I'm not sure whether it's already fixed or not.

The promptPurchase script:

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local gamePassID = 4713616  -- Change this to your game pass ID

-- Function to prompt purchase of the game pass
local function promptPurchase()

    local player = Players.LocalPlayer
    local hasPass = false

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

    if not success then
        warn("Error while checking if player has pass: " .. tostring(message))
        return
    end

    if hasPass == true then
        -- Player already owns the game pass; tell them somehow
    else
        -- Player does NOT own the game pass; prompt them to purchase
        MarketplaceService:PromptGamePassPurchase(player, gamePassID)
    end
end

script.Parent.MouseButton1Click:connect(function()
    local player = Players.LocalPlayer
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassID)
end)

Thanks!

0
I have the same problem ;( I found something that might answer a few questions https://devforum.roblox.com/t/gamepass-purchase-prompt-window-shows-wrong-thumbnail/118885 Faazo 84 — 6y
0
Yeah I saw that one as well! A Roblox staff member commented on that post, saying they were looking into it. But that was 2 months ago :S Allineate 22 — 6y
0
They are making changes to the apis https://devforum.roblox.com/t/changes-to-badge-apis/140319 User#5423 17 — 6y

Answer this question