#Madara Posted August 8, 2015 Share Posted August 8, 2015 hi guys i want to save table in file i make this : local table_Madara = { } table_Madara[1] = {["name"] = "Madara", ["email"] = "..@outlook" } addEventHandler ( "onResourceStop", root, function ( ) local jsonMYtable = toJSON (table_Madara) file = fileOpen ( "Json.lua" ) if file then fileWrite (file,jsonMYtable) fileClose ( file ) end end ) now how i can put what i save in the file in the table with using fromJSON ? Link to comment
KariiiM Posted August 8, 2015 Share Posted August 8, 2015 I think you can save it in xml not in lua file but 'not sure 100%' Link to comment
GTX Posted August 8, 2015 Share Posted August 8, 2015 You can save it anywhere, as long as it's correct JSON syntax in the file. file = fileOpen"Json.lua" if file then table = fromJSON(fileRead(file, fileGetSize(file))) end Link to comment
#Madara Posted August 8, 2015 Author Share Posted August 8, 2015 You can save it anywhere, as long as it's correct JSON syntax in the file. file = fileOpen"Json.lua" if file then table = fromJSON(fileRead(file, fileGetSize(file))) end thank you . Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now