can t parse json roblox

by Dr. Mayra Pollich MD 10 min read
image

You need to make a web request to that endpoint first, which will return the JSON to decode. Keep in mind you can’t make requests to *.roblox.com or roblox.com itself using HttpService, so you will have to use a proxy. 3 Likes LukeGabrieI (Luke) January 4, 2021, 10:31pm #3

Full Answer

Can you make requests to roblox.com?

Keep in mind you can’t make requests to *.roblox.com or roblox.comitself using HttpService, so you will have to use a proxy.

Does JSONDecode go out?

JSONDecode doesn’t go out and fetch the data from a URL. All it does is turn a JSON string into a Lua table. So you’ll have to use RequestAsync to first fetch the data, and then feed it into JSONDecode. And yeah, you’ll have to use a proxy if you’re hitting endpoints within the Roblox domain.

Encoding

This code snippet encodes characterStats into a JSON string and prints it to the output.

Decoding

This code snippet converts the JSON value created above back into its table representation, then prints its money value to the output.

What is a JSONDecode function?

The JSONDecode function transforms a JSON object or array into a Lua table with the following characteristics:

What does an empty JSON object generate?

An empty JSON object generates an empty Lua table {}.

image