Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is JSONDecode showing as tables?

Asked by
rootx 15
10 years ago

Here's my code.

local connect = game:GetService("HttpService")
local list = connect:GetAsync('DeletedURL')
local decode = connect:JSONDecode(list)
print(decode)

Output: table: 1AE3E948 table: 1B130E18

1 answer

Log in to vote
3
Answered by 10 years ago

...Because JSONDecode returns a table?

Check out the documentation.

0
Okay. So how would I make it show up as regular text instead of JSON rootx 15 — 10y
0
Do you understand what JSON is? It's a way to structure your data. If you want the raw JSON, then you do not need to do anything extra to the string that you are getting from the GetAsync method. User#11893 186 — 10y
0
Okay here's my JSON { PLAYER_ID: "4", BAN_REASON: "Speed hacking", id: 3 }, I want to get the text from Player_ID: and BAN_REASON: rootx 15 — 10y
0
Then you will be able to access your keys by using: print(decode.PLAYER_ID, decode.BAN_REASON) -- etc User#11893 186 — 10y
View all comments (2 more)
0
Quick note: JSON is just a "tool" or "syntax" on how we convert tables to strings and back. Because it has a kind of "syntax", other languages can also use this - you can share tables (or lists/arrays) between other languages and programs. jobro13 980 — 10y
0
It's printing NIL, NIL now rootx 15 — 10y
Ad

Answer this question