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
Keep in mind you can’t make requests to *.roblox.com or roblox.comitself using HttpService, so you will have to use a proxy.
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.
This code snippet encodes characterStats into a JSON string and prints it to the output.
This code snippet converts the JSON value created above back into its table representation, then prints its money value to the output.
The JSONDecode function transforms a JSON object or array into a Lua table with the following characteristics:
An empty JSON object generates an empty Lua table {}.