GSmGpE6CwX2y9JjB25B8
We use cookies on this site to enhance your user experience

Aug 29 2019, 9:17 AM PST 2 min

JSON is a data storage format. In Roblox, HttpService provides two functions for working with JSON data:

  • HttpService/JSONEncode|HttpService:JSONEncode() converts a variable to its JSON equivalent.
  • HttpService/JSONDecode|HttpService:JSONDecode() converts a JSON value to its Lua representation.

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.

Tags:
  • json
  • lua