Posted 10 October 2012 - 12:10 AM
Okay, so. I thought this sort of thing would work, but for some reason, it does not. The problem is that when I set a variable equal to something, and then try to create a file named after it, it gives me the error "Can't cocantanate string and nil" or whatever. It works if I set the variable equal to a string, but for what I'm doing, it can't be set to one. The error is on line four.
And I also tried this:
The latter one actually goes through with making it, but the file is called "nil" instead of "top" like it should be, so it's not working, and I can't seem to figure it out. ._.
rsoutput = top
currentB = false
fs.makeDir("saves")
local file = fs.open("saves/"..rsoutput, "w") --This line.
file.writeLine(currentB)
file.close()
And I also tried this:
rsoutput = top
currentB = false
fs.makeDir("saves")
local file = fs.open("saves/"..tostring(rsoutput), "w")
file.writeLine(currentB)
file.close()
The latter one actually goes through with making it, but the file is called "nil" instead of "top" like it should be, so it's not working, and I can't seem to figure it out. ._.