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

Gamepass Surface GUI Not Working?

Asked by 10 years ago

So ive got a surface gui with a textbutton. In that textbutton there is a local script with this script:

1local gamepass = 254533582
2local player = game.Players.LocalPlayer
3 
4script.Parent.MouseButton1Click:connect(function()
5    game:GetService("MarketplaceService"):PromptPurchase(player, gamepass)
6end)

When i click it, nothing happens and i dont know why!

3 answers

Log in to vote
0
Answered by 10 years ago

Did you put it into a localscript? If you did, try this:

-make sure it's a textButton

-or insert the following:

1local  player=game.Players.LocalPlayer
2local gamepassId=254533582
3 
4function Click()
5Game:GetService("MarketplaceService"):PromptPurchase(player, gamepassId)
6 end
7 
8script.Parent.MouseButton1Click:connect(Click)

If this doesn't work, I'm clueless. I'm not very familiar with MarketPlaceService.

Hope this helped!

-ds

0
Nope LittleBigDeveloper 245 — 10y
0
you're gonna need an adornee unmiss 337 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Is there any output? Make sure you are using the right command, there is a difference in between PromtPurchase, and PromtProductPurchase(), PromptPurchase is for developer products, while PromtProductPurchase() is for roblox-made products(catalog items)

Let me know if this works, if not I can try help you with other stuff, I have made my own market place stuff before, by the way, it may not work in studio mode, you will see something pop up in output about that if so, itll say something like "can't use this API in play solo mode"

Log in to vote
0
Answered by 8 years ago

This LocalScript will only work if an adornee was set. Try putting the SurfaceGui in the StarterGui, insert a script inside of the SurfaceGui, and then, put this:

1script.Parent.Adornee = game.Workspace.Part -- Change to the old destination of the surfacegui or whatever

Answer this question