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

How to make a Textbutton in a SurfaceGUI enable a Gamepass Prompt?

Asked by 2 years ago

i want a part so when i press the button on the front (I already have the GUI done), a gamepass prompt pops up

here's what I have

local GamepassId = 105980615

script.Parent.MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)
end)

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
2 years ago
Edited 2 years ago

Basically, you just need to put the SurfaceGui to the StarterGui and make the SurfaceGui's adornee property to the part.

Since LocalScript doesn't run if its inside workspace, so this should fix the problem.

Ad

Answer this question