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

How do i make a script which askes player for buying the gamepass on a gui? [closed]

Asked by 4 years ago

i made a gui and checked some tutorials for making marketplacescervice on mousebutton1clicked on the gui but didnt work.

Closed as Not Constructive by Arkrei, SuperSamyGamer, and User#6546

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
moo1210 587 Moderation Voter
4 years ago

To sell a gamepass you should use PromptGamePassPurchase for example

local marketplaceservice = game:GetService("MarketplaceService")
marketplaceservice.PromptGamePassPurchase(game.Players.playerusername,gamepassid)

Replace playerusername with the players username and replace gamepassid with the gamepass id, If you don't know what your ID is, go the gamepass, look at the url, for this example the url is https://www.roblox.com/game-pass/1057151/Excellent-Employee. Now look at the numbers inbetween in slash after the gamepass and slash before excellent, that is the gamepass ID. If this solved your answer be sure to hit the checkmark next to my answer and if you still need help feel free to reply to this question with it!

1
If you want to make it a gui, so if you press the button, it prompts the purchase, then you would just change the first value of the PromptGamePassPurchase to game.Players.LocalPlayer (this would only work if the GUI was local) Torren_Mr 334 — 4y
Ad