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

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

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

✓ Accepted answer

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.

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