Page 1 of 1

Help with running?

Posted: Sat Dec 06, 2014 9:54 pm
by tuckinrva
I keep trying to run my program but all that comes up is a error sign that says
Error
main.lua:3: attempt to concatenate local 'name' (a nil value)
Traceback
main.lua:3: in main chunck
[C]: in function 'require'
[C]: in function 'xpcall'
How do I fix this
code btw

Code: Select all

io.write("Hello what is your name?")
local name = io.read()
io.write("Hello " .. name)
io.write("You are in your bedroom, there is a door to your left and a desk to your right, Do you 'look_at_desk' or 'leave_room'")
local choice = io.read()

Re: Help with running?

Posted: Sat Dec 06, 2014 11:22 pm
by davisdude
If you don't have the console enabled you can't use io.read
That may be a problem.

Re: Help with running?

Posted: Sun Dec 07, 2014 10:29 pm
by tuckinrva
Thanks