Jump to content




Issues with my program


  • You cannot reply to this topic
1 reply to this topic

#1 minerlogo

  • New Members
  • 1 posts

Posted 28 November 2015 - 08:46 PM

I was making a program for my minecarts and then when i put this loop

local x = 15

if x = 15 and turtle.detect()==true
then do throwAway() -- this is one of my functions above, I know this works
else do turtle.detect()

When i run this it shows me the error

bios:14: [string ".temp"]:27: 'then' expected. if someone could help that would be awesome.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 28 November 2015 - 11:05 PM

Lua did not expect a single = to be used when parsing the conditional for your "if" statement. Use "x == 15" instead.

You'll likely also want to get rid of that redundant "do". "for" statements need 'em, but they're seldom useful otherwise.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users