Posted 05 October 2015 - 04:53 PM
Hey, i would like some help/understanding with what is causing this problem. It keeps returning "attempt to get length of nil" at the line "MasterTable[#MasterTable+1] = Settings"
Have a nice day. :D/>
MasterTable = {}
if not fs.exists("settings") then
local FileCreating = io.open("settings", "w")
FileCreating:write()
FileCreating:close()
end
function FileWrite()
local FileInput = io.open("settings", "w")
FileInput:write(textutils.serialize (MasterTable))
FileInput:close()
end
function FileRead()
local FileOutput = fs.open("settings","r")
local Filedata = FileOutput.readAll()
FileOutput.close()
return textutils.unserialize(Filedata)
end
function Input()
Settings = {}
for i=1,3 do
Settings[#Settings+1] = io.read()
end
textutils.tabulate(Settings)
MasterTable[#MasterTable+1] = Settings
FileWrite()
shell.run("startup")
end
MasterTable = FileRead()
Input()
Have a nice day. :D/>