• [Q] "if ( ... ) then" question..
    5 replies, posted
Well in other languages you can do something like this: [CODE]if pl:Alive() then[/CODE] How can I do that it will check either one of the conditions? Something like this: [CODE]if (pl:Alive() || pl.Menu!=0) then[/CODE] I know the method on how to do it both, trying to figure out the proper syntax for "either"
I don't follow. You just answered your own question? In Lua, you have "if ( a or b || c ) then", if a OR b OR c equals to true, the if will pass, if all are false, it wont. There's also "if ( a and b && c ) then" which will pass only if a AND b AND c all equal to true. The || and && are not available in normal Lua.
if A or B ? Ninja'd :v:
I don't understand what you're asking; both code snippets you posted has proper syntax
[QUOTE=Robotboy655;48583244]I don't follow. You just answered your own question? In Lua, you have "if ( a or b || c ) then", if a OR b OR c equals to true, the if will pass, if all are false, it wont. There's also "if ( a and b && c ) then" which will pass only if a AND b AND c all equal to true. The || and && are not available in normal Lua.[/QUOTE] Where's the facepalm button? thanks for the help!
Sorry, you need to Log In to post a reply to this thread.