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: I need help with Web API

Previous Thread :: Next Thread 
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 03:52 PM
So I tried making a script that gives me a JSON List of the Catalog: hs = game:GetService("HttpService") myTableJSON = ############################################################################################### true) myTable = hs:JSONDecode(myTableJSON) print(myTableJSON) But in my output I get this: "23C25B28" But if I don't Decode it I get a whole JSON List But My script doesn't recognize it as a Table. How can I convert the JSON list into a Table?
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 03:56 PM
For the TableJSON Part its:
myTableJSON = hs:GetAsync("WebsiteNameHere", true)

(Sorry it got Hashtagged)
Report Abuse
TaaRt is online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
13 Jan 2017 03:59 PM
Uhh, you're printing the table, which returns a hexadecimal memory adress to where the table is located.
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
13 Jan 2017 03:59 PM
You can't print a table's content by using print(table), that will give you the memory address it's stored on.

try this:

for i,v in pairs (table) do
print(i,v)
end


I suggest you read these articles:

http://wiki.roblox.com/index.php?title=Table

http://wiki.roblox.com/index.php?title=Loops#For

http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#pairs
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:00 PM
########################################################################################################
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:01 PM
##############################################################################################################################
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:01 PM
om why is this happening


- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:02 PM
THERE

OK TO PRINT PART OF A TABLE, PUT THIS

{table}[value in table]

for example

cars[5]


- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 04:02 PM
So how can I convert the JSON List into a Table?
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:03 PM
it is already a table


- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
13 Jan 2017 04:04 PM
You already did here:

hs:JSONDecode(myTableJSON)


I suggest just following this tutorial before doing something with the HttpService


http://wiki.roblox.com/index.php?title=Sending_HTTP_requests

http://wiki.roblox.com/index.php?title=API:Class/HttpService
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 04:05 PM
I tried doing this:

print(MyTableJSON[1]) but that didn't work...
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:06 PM
Dude you can't just say "it didnt work"

elaborate


- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 04:09 PM
I get this in my OutPut:
"nil"
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
13 Jan 2017 04:10 PM
Try

print(myTable[1])
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:10 PM
pls dont put a capital on put thats not how scripting works output isnt a variable name


- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 04:11 PM
I get this in my output:
table: 1F299100
Report Abuse
SteadyOn is not online. SteadyOn
Joined: 20 Mar 2011
Total Posts: 600
13 Jan 2017 04:13 PM
wait what is there a table with in a table or something


- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
13 Jan 2017 04:15 PM
Yes, there is a table in a table,

try print(myTable[1][1])

(maybe you could have thought of that yourself)
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 04:15 PM
Why when I print out Items of my Table it gives me a code?
Like this:
1F299100
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
13 Jan 2017 04:15 PM
I suggest reading this article before continuing:


http://wiki.roblox.com/index.php?title=Table
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
13 Jan 2017 04:19 PM
I tried this:
print(myTable[1][1])

I get "nil"
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
13 Jan 2017 04:20 PM
Ok for this time try to think yourself.

What does that mean you think?

Use all the info u got
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Jan 2017 04:21 PM
PM me the link to this website and I'll help you.
Report Abuse
Kutoru is not online. Kutoru
Joined: 22 May 2016
Total Posts: 288
13 Jan 2017 04:25 PM
{
"glossary": {
"title": "example glossary"
}
}

tab.glossary.title
tab["glossary"]["title"]
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