Such as this
{{"name":"Joe","Message":"This is a test"},{....}}
Such as this
{{"name":"Joe","Message":"This is a test"},{....}}
In standard Lua versions, there is none. You'd have to make a parser yourself to encode/decode JSON strings, or objects. ROBLOX, however, has an API for handling this parsing for us via HttpService, where you can use JSONEncode and JSONDecode (see here). Note that you do not need HttpEnabled set to true to use this API. Example:
local http = game:GetService("HttpService")
local data = {a = 1, b = 2, c = 3}
print(http:JSONEncode(data)) -- > {"b":2,"c":3,"a":1}
print(http:JSONDecode("{\"b\":2,\"c\":3,\"a\":1}")) -- > table: ########
While Json is not directly supported by Roblox's Lua, there is a way to use JSON tables. This can be achieved through use of HTTPService.
But how do we do it?
This can be achieved through use of JSONDecode. JSONDecode converts JSON into ye-old Lua tables. JSONDecode takes a string argument, meaning that your JSON table will have to be a string. It can be used like so:
game:GetService("HttpService"):JSONDecode('{{"name":"Joe","Message":"This is a test"},{....}}
')
This discussion is preserved as it was. New answers, comments, and votes are closed.