Jump to content

conditional conditionals?

command utility lua

1 reply to this topic

#1 ackley14

  • Members
  • 8 posts

Posted 27 July 2015 - 01:06 AM

im wondering if its possible to do something like

if ((a == a and b == B)/> or (c == c and d == d)) then
--do stuff

I'd rather not have to have multiple if statments all do the same thing and unfortunately i can't really use a proper function right now (that i can think of atleast) without things getting wonky

#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 27 July 2015 - 01:09 AM

Yes. Although where you'd be comparing 8 variables like that I have no idea.

The 'and' / 'or' stuff is easily demonstrated like this:
print( true and false )
print( false and true )
print( true and true )
print( false or true )
print( false or false )

...and of course, you can combine them. Using (), you can control the "order of operations".

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users