Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

lua json decode

-- If you do not use this for FiveM, there are several packages that can do what you are looking for.
-- I would recommend the implementation that FiveM has in pure LuA, it is very easy to use. 
-- https://github.com/citizenfx/fivem/blob/master/code/tools/build/json.lua

-- You use it like this:

local table = {x = 5}
local encodeTable = json.encode(table) -- returns '{"x":5}'
local decodedTable = json.decode(encodedTable) -- returns {x = 5}
print(decodedTable.x) -- returns 5
 
PREVIOUS NEXT
Tagged: #lua #json #decode
ADD COMMENT
Topic
Name
5+7 =