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: GetProductInfo

Previous Thread :: Next Thread 
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
30 Jun 2013 10:26 AM
How do I use it?
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
30 Jun 2013 10:34 AM
local Prod = game:GetService("MarketplaceService"):GetProductInfo(77359785)

for _,v in pairs(Prod) do
    print(_)
end

print("[[===========================]]")
print("Creator: "..Prod.Creator.Name.." || Published: "..Prod.Created)
print("Price: "..Prod.PriceInRobux.."R$ || "..Prod.PriceInTickets.." Tix")
print("Description: "..Prod.Description)


---

The above will print all of the keys of the 'key value pair'. You can then use it how you wish. I, for example, have printed the creator, publish time, price and description of an item.
Report Abuse
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
30 Jun 2013 10:38 AM
How do you use the "Prod.Creator.Name"? in pairs is something I haven't touched with scripting. I thought GetProductInfo just returns a table?
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
30 Jun 2013 10:41 AM
Yes, it does return a table. The table is dictionary, so it has key value pairs.

For example,
local Product = {
["Foo"] = "Hmph";
["Bar"] = "Bleh";
}

Prod is a variable I've created further up the script. I'm using a loop to iterate through the table, to find out all of the keys I can use. All of these are present, whenevr you use the ':GetProductInfo()' method. Just trying to show you all of the 'things' you can utilise.

If that makes sense...
Report Abuse
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
30 Jun 2013 10:43 AM
Yeah, I know that Prod was the table value but I didn't know that it returned a dictionary. Thanks, I get it now :p
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
30 Jun 2013 10:45 AM
Does GetProductInfo return its asset type ie. Place / Decal / Clothing / Gear ?
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
30 Jun 2013 10:46 AM
as part of the dictionary ofcourse
Report Abuse
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
30 Jun 2013 10:47 AM
It returns AssetTypeId. For example, hats are 8.
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
30 Jun 2013 10:49 AM
thanks :)
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