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

How do I fix a Billboard GUI that when clicked a game-pass prompt comes up?

So I'm trying to make a billboard with a billboard GUI that when clicked comes up with a prompt to buy a game pass, and it seems the script won't work what did I do wrong?

script.Parent.Touched:connect(function(part) 
local player = game.Players:GetPlayerFromCharacter(part.Parent) game:GetService("MarketplaceService"):PromptPurchase(player, 0) 
end)

2 comments

0
  1. touched does not mean click. 2. the gamepass id is definitely not 0
0

After you left, I re edited my answer, it should work now, just re read all of it

1 answer

✓ Accepted answer

First of all, your gamepass Id can't possibly be 0 so you have to change the second argument to your actual gamepass' id.

game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 6832709)

Also, you would need to use the MouseButton1Click Event. So overall your script should look like this:

local SegwayButton = game.Workspace.UpdateBoard.Sign1.SurfaceGui:FindFirstChild("SegwayButton")
SegwayButton.MouseButton1Click:connect(function() 
local player = game.Players.LocalPlayer
game:GetService("MarketplaceService"):PromptGamePassPurchase(player,6832709) 
end)

Make sure it's a local script that is parented to starter pack since

"LocalScripts can use surface UI's too, its just they won't replicate." - TheeDeathCaster

So there ya go, glad I could be of any help :)

3 comments

0

I did this all and its not showing me gamepass prompt I think its because most people think this 6832709 is not a game pass ID what it wants is a developer product and the item im selling needs to all ways be with the player when they die and when the rejoin the game.

0

That's a gamepass

0

So like this? local SegwayButton = game.Workspace.Part.SurfaceGui.TextButton Button.MouseButton1Click:connect(function() local player = game.Players.LocalPlayer game:GetService("MarketplaceService"):PromptGamePassPurchase(player,6832709) end)

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