generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help, Gamepass Buy GUI Script

Previous Thread :: Next Thread 
StingrayXD is not online. StingrayXD
Joined: 04 Jun 2012
Total Posts: 3237
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 is online. 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 is online. mark11101
Joined: 11 May 2012
Total Posts: 53
12 Jul 2017 02:57 PM
Damn

pastebin
qkNVTWVr
Report Abuse
StingrayXD is not online. StingrayXD
Joined: 04 Jun 2012
Total Posts: 3237
12 Jul 2017 02:59 PM
oh no
Report Abuse
mark11101 is online. mark11101
Joined: 11 May 2012
Total Posts: 53
12 Jul 2017 03:02 PM
Oh no what?
Report Abuse
StingrayXD is not online. StingrayXD
Joined: 04 Jun 2012
Total Posts: 3237
12 Jul 2017 03:06 PM
It hastaged it
Report Abuse
mark11101 is online. 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
ImperialThinking is not online. ImperialThinking
Joined: 16 Jun 2016
Total Posts: 144
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
StingrayXD is not online. StingrayXD
Joined: 04 Jun 2012
Total Posts: 3237
12 Jul 2017 08:11 PM
Alright, thank you for that.
Report Abuse
Robloxinaterr is not online. Robloxinaterr
Joined: 26 Jul 2014
Total Posts: 14824
12 Jul 2017 08:26 PM
Just type in gamepass gui in toolbox, but looks like you need a dif script.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image