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: How would I...

Previous Thread :: Next Thread 
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 07:32 PM
make it so when someone clicked a GUI, it prompted them to buy?

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
UnforeseenVice is not online. UnforeseenVice
Joined: 27 Mar 2009
Total Posts: 1078
07 Mar 2016 07:33 PM
This might be able to help you: http://wiki.roblox.com/index.php?title=Developer_product
Report Abuse
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 07:33 PM
Forgot to mention, it's with a gamepass. Not Dev Product.

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
UnforeseenVice is not online. UnforeseenVice
Joined: 27 Mar 2009
Total Posts: 1078
07 Mar 2016 07:34 PM
Here you go, this should be able to help then: http://wiki.roblox.com/index.php?title=Game_pass
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 07:35 PM
http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService

this helps alot


4 8 15 16 23 42
Report Abuse
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 07:37 PM
I made a post about this yesterday, but I lost the answer. It was a simple, one-line code?

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 07:45 PM
MP = game:service'MarketplaceService'

MP:PromptPurchase (
Player player,
int assetId,
bool equipIfPurchased = true,
CurrencyType currencyType = Default
)

taken from the wiki and modified by 2 letters


4 8 15 16 23 42
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 07:45 PM
or

http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PromptPurchase


4 8 15 16 23 42
Report Abuse
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 07:49 PM
Would those prompt the player, if they clicked on the GUI?

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 07:50 PM
MP = game:service'MarketplaceService'
LP = game:service'Players'.LocalPlayer

[button thing].MouseButton1Click:connect(function()
MP:PromptPurchase(LP, assetId)
end)

replace [button thing] to your button


4 8 15 16 23 42
Report Abuse
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 07:51 PM
^ I'll try it.

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 07:57 PM
This is what it ended up being...


MP = game:service'MarketplaceService'
LP = game:service'Players'.LocalPlayer

game.StarterGui.Upgrade.Frame.ImageButton1.MouseButton1Click:connect(function()
MP:PromptPurchase(LP, 377553402)
end)


...and it still did nothing. There is no error in the Output either.

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 08:00 PM
is it in a localscript, it worked for me here:

http://www.roblox.com/games/331251574/no


4 8 15 16 23 42
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 08:01 PM
oh and the button is on the side


4 8 15 16 23 42
Report Abuse
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 08:04 PM
https://gyazo.com/49016e813a10d26900c5ced029a3ff89

^ Here. And yes, it is in a local script.

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 08:05 PM
hit f9, goto server log or whatever, if there is anything that relates to the MarketplaceService, say here


4 8 15 16 23 42
Report Abuse
SimplyGhostly is not online. SimplyGhostly
Joined: 09 Nov 2013
Total Posts: 1163
07 Mar 2016 08:12 PM
I don't have an F9. My "F9" turns my screen off.

"But wait, there's more!" -Billy Mays http://www.roblox.com/Source-Stud-Tee-item?id=348585649
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 08:13 PM
hit escape, 'help' then 'log'


4 8 15 16 23 42
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
07 Mar 2016 08:15 PM
otherwise, i cant help you sorry


4 8 15 16 23 42
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
07 Mar 2016 08:54 PM
Ugghhhhh...


Okay, so you would use a .MouseButton1Click on the TextButton or ImageButton; like so.


local player = game:GetService("Players").LocalPlayer
local marketplaceservice = game:GetService("MarketplaceService")
player.PlayerGui.Upgrade.Frame["ImageButton1"].MouseButton1Click:connect(function()
marketplaceservice:PromptPurchase(player, ItemID)
end)

The :PromptPurchase has two required parameters, which player you want to prompt to purchase, and the second parameter is the Id of the item you want them to purchase. The not needed parameters are, EquipifPurchased, which will equip the item if they choose to purchase it and it only works on gears; that is a bool and defaults to 'true'. The other un needed parameter is CurrencyType, this is the type of ROBLOX Currency you would like the user to be prompted in. This defaults to, Enum.CurrencyType.Default which you can search up more about here; http://wiki.roblox.com/index.php?title=API:Enum/CurrencyType

Here, are the web pages used to create the script.
Search up more about the functions here,

http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService

http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PromptPurchase

http://wiki.roblox.com/index.php?title=API:Class/Players/LocalPlayer

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