Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Gamepass Prompt script doesn't show up. Fix?

I created a billboard shop, if that makes sense. Where the player can walk up to it and press the buy button to buy a gamepass.

I replaced the id with 0 just for this example.

local id = 0000000
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
game.MarketplaceService:PromptGamePassPurchase(player, id)
end)

This doesn't work however. There are no errors in output.

1 comment

0

I'm assuming this is a LocalScript, correct? Where is it located?

2 answers

change game.MarketplaceService to game:GetService(“MarketplaceService”)

2 comments

0

Same thing happened. Nothing popped up.

0

try a print test when the button is clicked. Does anything print?

Hello!

I see the problem that you are having, and here is a quite simple fix! All you need is a LocalScript inside StarterCharacterScripts which can be found under StarterPlayer, after you created the LocalScript inside StarterCharacterScripts You can name it anything!

Open the LocalScript and enter this code, I have commented on it on what to change!

local GamepassPurchaseButton = game.Workspace.BillboardShop.SurfaceGui.Frame:FindFirstChild("TextButton") -- Change it to your BillboardGui names and put the "TextButton" to your button name!
local Player = game:GetService("Players").LocalPlayer

GamepassPurchaseButton.MouseButton1Click:Connect(function() 
game:GetService("MarketplaceService"):PromptGamePassPurchase(Player,000000)  -- Change 000000 to your Gamepass ID!
end)

Hope this works for you!

This discussion is preserved as it was. New answers, comments, and votes are closed.