Posted 31 December 2012 - 10:52 AM
I can't figure out why I keep getting "bios:388: [string "digIt"]:5: 'then' expected" in this code, even though there is a 'then' in the code
I just started Lua, so go easy on me if its a stupid question
I just started Lua, so go easy on me if its a stupid question
while true do
print("Enter the direction")
d = read()
if d = "u" then
print("Go Up")
elseif d = "d" then
print("Go Down")
elseif d = "f" then
print("Go Forward")
elseif d = "r" then
print("Go Right")
elseif d = "b" then
print("Go Back")
elseif d = "l" then
print("Go Left")
elseif d = "n" then
print("Shutdown")
break
else
print("Please enter correct direction")
end
By the way I know this code doesn't do anything except print text right now, I will be adding the moving and digging commands later on, after I figure out how to get the the if statements working.