• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.2 attempt to index global 'json' (a boolean value)

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
1,067
Solutions
5
Reaction score
63
aaa243a1c49d9b5f99fd92761cf256e8.png


compact.lua
LUA:
function parseToJson(data, fileName)
    local fileEx = string.format("data/json/%s.json", fileName)
    local outputFile = fileEx
 
    json = require('data/lib/custom/json')

    fileEx = io.open(fileEx, "w+")
    fileEx:write(json.stringify(data))
    fileEx:close()
 
    print("#############################")
    print("File saved as " .. outputFile)
    print("----")
    print(fileName .. " parsed to JSON")
    return true
end

json.lua
 
Back
Top