Search
 
SCRIPT & CODE EXAMPLE
 

LUA

lua json

local personString = '{"name": "Squid", "job": "dev"}' -- A JSON string
-- If you need to turn the json into an object:
local personJSON = json.decode(personString)
-- Now you can use it like any table:
personJSON["name"] = "Illusion Squid"
personJSON.job = "Software Engineer"
-- If you have an object and want to make it a JSON string do this:
local newPersonString = json.encode(personJSON)
-- Simple!
Comment

lua json

-- 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
Comment

PREVIOUS NEXT
Code Example
Lua :: json resume shema 
Lua :: roblox math.random 
Lua :: lua documentation 
Lua :: loop roblox studio 
Lua :: how to print a variable in lua 
Lua :: roblox lua wait for player to load 
Lua :: datastore roblox 
Lua :: lua function 
Lua :: lua empty table 
Lua :: roblox touch part kill script 
Lua :: roblox get how many players in server 
Lua :: type lua 
Lua :: lua pairs 
Lua :: exemple boolean and why it is used 
Lua :: table.move lua 
Lua :: animation event firing too many times roblox 
Matlab :: matlab rlocus 
Matlab :: matlab single and double 
Matlab :: z-score normalize values in tsv file matlab 
Basic :: virtualbox 256 vram 
Basic :: remove button selection outline visual basic 
Elixir :: hello world in elixir 
Elixir :: liveview component 
Scala :: scalable meaning 
Scala :: scala get set of chars from string 
Excel :: remove space from excel cell 
Perl :: perl loops 
Perl :: perl running mechanize through tor 
Powershell :: powershell display firewall rules name 
Gdscript :: godot print enum name 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =