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 » Scripting Helpers
Home Search
 

Re: Buying stuff in-game?

Previous Thread :: Next Thread 
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 04:29 AM
A friend of mine told me that he went to a place yesterday and that he bought a few items in that place. He didn't want to, but he clicked something and he bought it.

Is that possible? Is it a new feature?
Report Abuse
juriaan is not online. juriaan
Joined: 25 Nov 2008
Total Posts: 939
08 May 2013 04:57 AM
That is possible.

It is called the MarketPlaceService
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 05:56 AM
So what you're saying is that I could make something in my place that uses the MarketPlaceService that makes people buy stuff?
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 06:00 AM
Yes it was featured in the blog, you can look for the article and get the " bloxy cola vending machine" to get a sample of code.
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 06:00 AM
Would this be the script to ask someone if he wants to buy the Jean Skull Cap?

game.Players.PlayerAdded:connect(function(plr)
game:GetService("MarketplaceService"):PromptPurchase(plr, 111904386)
end)
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 06:02 AM
I would have on a "onClicked" or "onTouched" function personally but It looks like that will work if you wanted to ask them as soon as they joined.
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 06:03 AM
By the way I am new to coding so I would get another persons opinion.
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 06:11 AM
Thank you.
I tried this in a ClickDetector:

mps = game:GetService("MarketplaceService")

script.Parent.MouseClick:connect(function(plr)
if mps:PlayerOwnsAsset(plr, 111904386) then
local m = Instance.new("Message", plr.PlayerGui)
m.Text = "You already own the Jean Skull Cap!"
game:GetService("Debris"):AddItem(m, 3.5)
else
mps:PromptPurchase(plr, 111904386)
end
end)

Each time I click it, I get the message that I already own the Jean Skull Cap, but I don't. Do you know why?
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 06:15 AM
Erm............TO THE ROBLOX WIKI!
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 06:22 AM
This is the article to PromptPurchase:

http://wiki.roblox.com/index.php/PromptPurchase_(Method)

And this is the article to PlayerOwnsAsset:

http://wiki.roblox.com/index.php/PlayerOwnsAsset_(Method)

I don't see why it says I own the hat.
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
08 May 2013 07:10 AM
DO YOU READ THE BLOG IN ANYWAY FKING WAY!!!
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
08 May 2013 07:12 AM
Are you testing in online or solo?
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 09:53 AM
Online, because I got the error that I was a guest and not a player in solo mode.
I didn't get a message if I wanted the item though.
Is this feature only for ROBLOX places or something? Like with their places where you can win hats?
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 02:42 PM
It's for everyone, I am actually going to start working on it after I get done with another project you helped me on. =P
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 03:12 PM
The code looks perfect to me, maybe since it is a new release they just have to fix a few bugs?
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 03:19 PM
I don't know if it's new. I haven't seen it a lot, but I think they would've announced it somewhere if they did recently.
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 03:28 PM
They put it in the blog that they recently made it.
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 03:57 PM
I cannot find it, do you have a link to it?
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
08 May 2013 06:15 PM
Does anyone have a link to it? q_q
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
08 May 2013 06:41 PM
http://blog.roblox.com/2013/05/sell-game-passes-and-gear-in-your-game-today/
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
09 May 2013 05:02 AM
Aha, thank you. I'll try it with a gear item now then.
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
09 May 2013 05:43 AM
I tried it with a Gravity Coil, but again, I got the message that I already have it. But I don't.
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
09 May 2013 05:57 AM
When I removed the PlayerOwnsAsset part, it did work. Is there a problem with PlayerOwnsAsset then?
Report Abuse
Aerok is not online. Aerok
Joined: 04 May 2013
Total Posts: 33
09 May 2013 06:04 AM
That's what I guessed.
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
09 May 2013 07:04 AM
Thank you for your help, I think I'm gonna use this some more.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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