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

if Help

Started by likilike1234, 29 January 2018 - 08:48 AM
likilike1234 #1
Posted 29 January 2018 - 09:48 AM
Hello I need help with this code please.
Not work.
Sorry for my English

if SX > 0
if DX > 0
X = SX - DX
X = math.abs(X)
EAST = 1
end
end
Bomb Bloke #2
Posted 30 January 2018 - 12:54 AM
You haven't defined SX / DX, so you can't compare them to 0. Is this your whole script?

You're also missing "then" keywords to go with your "if" keywords: http://lua-users.org/wiki/ControlStructureTutorial
EveryOS #3
Posted 30 January 2018 - 01:07 AM
You should put your code in a code block when posting. Also, make sure to indent your code.
likilike1234 #4
Posted 31 January 2018 - 05:41 AM
OK sorry and thanks but i find solution.