I'm trying to make a Text button on a surface Gui that tells the person to buy a gamepass and this script I have doesn't work... It's in a local script I don't know what to do...
local player=game.Players.LocalPlayer
local gamepassId=483446658
function Click()
game:GetService("MarketplaceService"):PromptPurchase(player, gamepassId)
end
script.Parent.MouseButton1Click:connect(Click)

8 comments
What do I need to do?
You need to put your surfacegui in StarterGui and run this in the command bar "game.StarterGui.SurfaceGui.Adornee = workspace:FindFirstChild("Whatever part you want it on");" and that will make it so that you can change it from inside the startergui and the players can click it
Its not working ;-;
That just made it so I could type in the box I want it so the user can press on the buy vip button and its tells them to buy it.
GOT IT
Thanks so much! I've been looking everywhere!
No problem. I had this same problem a year back and when I finally found out how to do it I felt stupid. xD
xD I do feel stupid that its that simple... Well I'm new to scripting. Thanks again!