 
                
                15 posts
                
             
            
                Posted 20 January 2013 - 12:22 PM
                local engines = false
print("engines on or off?")
question == io.read()
while true do
 if question == on then
  engines = true
  term.clear()
  break
 else
  if question == off then
   engines = false
   term.clear()
   break
  else
   print("You need to say ON or OFF!")
  end
 end
end
——————-
this is my code can someone tell what is wrong with it.
                
             
         
        
        
            
            
                
                     
                
                7508 posts
                
                    
                        Location
                        Australia
                    
                
             
            
                Posted 20 January 2013 - 12:25 PM
                since you are reading the question from the user, when checking it you should do this
if question == "on" then
  -- code
elseif question == "off" then
  -- code
else
  -- code
end
Also when you get error messages, please post them, it helps us help you quicker…
Also please try to use [
code][
/code] tags around your code
 
         
        
        
            
            
                
                     
                
                892 posts
                
                    
                        Location
                        Where you'd least expect it.
                    
                
             
            
                Posted 20 January 2013 - 01:02 PM
                since you are reading the question from the user, when checking it you should do this
if question == "on" then
  -- code
elseif question == "off" then
  -- code
else
  -- code
end
Also when you get error messages, please post them, it helps us help you quicker…
Also please try to use [
code][
/code] tags around your code
Also ask in the Ask A Pro section. Just sayin' :D/>
 
         
        
        
            
            
                
                     
                
                7508 posts
                
                    
                        Location
                        Australia
                    
                
             
            
                Posted 20 January 2013 - 01:04 PM
                Also ask in the Ask A Pro section. Just sayin' :D/>
This one was here first… And I told him not to double post and that I have answered his question here…
 
         
        
        
            
            
                
                     
                
                892 posts
                
                    
                        Location
                        Where you'd least expect it.
                    
                
             
            
                Posted 20 January 2013 - 01:06 PM
                Also ask in the Ask A Pro section. Just sayin' :D/>
This one was here first… And I told him not to double post and that I have answered his question here…
O. Sorry! :P/>