fromJSON | Multi Theft Auto: Wiki Skip to content

fromJSON

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function parses a JSON formatted string into variables. You can use toJSON to encode variables into a JSON string that can be read by this function.

Syntax

fromJSON ( )

Code Examples

server

This makes data equal:{ ["1"] = "cat", ["2"] = "mouse", ["3"] = 5, ["4"] = null, ["cat"] = 5, ["mouse"] =1 }

local data = fromJSON ( '[ { "1": "cat", "2": "mouse", "3": 5, "4": null, "cat":5, "mouse":1 } ]' )