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

Game pass Text button surface gui!?!?! Please someone help?!?!?!?

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)

1 answer

✓ Accepted answer

The surfacegui needs to be in the StarterGui and you need to set the Adornee to the brick that you want it to display on.

8 comments

0

What do I need to do?

0

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

0

Its not working ;-;

0

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.

0

GOT IT

0

Thanks so much! I've been looking everywhere!

0

No problem. I had this same problem a year back and when I finally found out how to do it I felt stupid. xD

0

xD I do feel stupid that its that simple... Well I'm new to scripting. Thanks again!

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