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