Jump to content




If Statement Issues


1 reply to this topic

#1 Rectorian

  • Members
  • 3 posts

Posted 12 October 2016 - 02:47 AM

So, I've been working on my own little basic mining program for mining a long tube for a viaduct, and i've been having a problem, here is a rough copy of my program.

local n = 2000
local i = 10
local x = 0
while n>0 do
if i=10 then
x = x+16
while x>0 do
turtle.select(x)
turtle.refuel()
x = x-1
end
else
i = i+1
end
turtle.dig()
turtle.forward()
end

My problem is that whenever I try to run the program it says that it expects a then on line five. If you look at line 5, there is a then. If anyone has any help or information, that would be awesome. Thanks!

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 12 October 2016 - 03:20 AM

You're using an assignment operator (=) where you should be using a comparison operator (==).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users