|
| 12 Jul 2017 02:45 PM |
| I need a script for when you click on a GUI it lets you buy a gamepass, but I am not having any luck. I have the GUIs made, I just need the script for when you click it and it asks you if you want to buy the gamepass. |
|
|
| Report Abuse |
|
|
mark11101
|
  |
| Joined: 11 May 2012 |
| Total Posts: 53 |
|
|
| 12 Jul 2017 02:55 PM |
| local gamePassId = ######### script.Parent.ClickDetector.MouseClick:Connect(function(player) ########################################################## gamepassId) end) |
|
|
| Report Abuse |
|
|
mark11101
|
  |
| Joined: 11 May 2012 |
| Total Posts: 53 |
|
| |
|
| |
|
mark11101
|
  |
| Joined: 11 May 2012 |
| Total Posts: 53 |
|
| |
|
| |
|
mark11101
|
  |
| Joined: 11 May 2012 |
| Total Posts: 53 |
|
|
| 12 Jul 2017 03:14 PM |
Oh just copy the pastebin code and type in
pastebin . com / code |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2017 03:19 PM |
http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PromptPurchase
I assume you're using a text button. You can use this with an image button as well.
local passid = 123456 --Type your ID here local player = game.Players.LocalPlayer --Since this is a GUI, it must be a local script; therefore, we have local player here
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService") :Prompt Purchase (player, passed)
end)
REMOVE THE SPACES IN BETWEEN. I DID SPACES BECAUSE OF THE FILTER.
There's also a 3rd argument after passid in PromptPurchase. You can type "false" as an argument after "passid" to not equip the game pass after purchase. Leaving it as it is will equip the player with the game pass items. This "equipIfPurchased" argument defaults to true. |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2017 08:11 PM |
| Alright, thank you for that. |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2017 08:26 PM |
| Just type in gamepass gui in toolbox, but looks like you need a dif script. |
|
|
| Report Abuse |
|
|