Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to select a random value in a json array LUA

local open = io.open("array.json", "r")
local string = open:read("a")
local array = json.decode(string)
open:close()
local msg = array[math.random(1, #array)]
 
PREVIOUS NEXT
Tagged: #select #random #json #array #LUA
ADD COMMENT
Topic
Name
8+8 =