We use cookies on this site to enhance your user experience
JSON Storage Format
JSON Storage Format
JSON is a data storage format.
HttpService
provides two functions for working with JSON data:
HttpService/JSONEncode
, which converts a variable to its JSON equivalentHttpService/JSONDecode
, which converts a JSON value to its Lua representation
JSONEncode cannot encode anything other than strings, numbers, tables, and booleans - passing anything else to it will error.
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.