This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Nahis_Wayard's profile picture

Error : 'then' expected

Started by Nahis_Wayard, 22 April 2015 - 04:33 PM
Nahis_Wayard #1
Posted 22 April 2015 - 06:33 PM
Hello guys, first I want to say : I have read this Read This Post Before Asking Questions and I haven't found the anwser to my problem
So, there is my code :

rednet.open("left")
while true do
local senderId, message, protocol = rednet.receive()
if senderId == 28 then
  if message == "on"
   rs.setOutput("right", true)
  else
   rs.setOutput("right", false)
  end
end
end

And my error is : At line 7 and it's an 'then' expected
If someone can help me please :)/>
Lyqyd #2
Posted 22 April 2015 - 07:23 PM
You're missing a "then" on your second if line. The Common Errors section does mention that the "then" might actually be missing for this error message.