Posted 06 July 2017 - 05:28 AM
I'm pretty sure it's something wrong with how I'm using the FS api.
Returns startup:10: attempt to concatenate string and nil
Anybody have a fix?
shell.run("clear")
print("Lazuli Azure Resort and Spa")
print("---------------------------")
print(" ")
function pickRoom()
room = {101, 102, 103, 201, 202}
a = math.random(0,4)
numbRoom = tonumber(room[a])
dir = "rooms/"..numbRoom -- LINE 10
h = fs.open(dir, "r")
if h == "true" then
shell.run("clear")
print("Your room number is "..numbRoom..".")
local g = read()
h = fs.open(dir, "w")
h.write("false")
h.close()
pickroom()
else
pickRoom()
end
end
pickRoom()
Returns startup:10: attempt to concatenate string and nil
Anybody have a fix?
Edited on 06 July 2017 - 04:43 AM