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

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

Asked by 5 years ago
Edited 5 years ago

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)
0
1. touched does not mean click. 2. the gamepass id is definitely not 0 Fifkee 2017 — 5y
0
After you left, I re edited my answer, it should work now, just re read all of it Zologo 37 — 5y

1 answer

Log in to vote
1
Answered by
Zologo 37
5 years ago
Edited 5 years ago

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 :)

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. vincentthecat1 199 — 5y
0
That's a gamepass Zologo 37 — 5y
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) vincentthecat1 199 — 5y
Ad

Answer this question