Ad
Log in to vote
0

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

Asked by 11 days 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 2602 Moderation Voter Community Moderator
11 days ago
Edited 11 days 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