• if () or () then works in lua?
    2 replies, posted
I wonder if [CODE] a = true b = false if a == true or b == true then c = true end[/CODE] works in lua? As I tried, I failed, so now I use some retarded code: [CODE] wins = 0 a = true b = false if a == true then wins = wins +1 end if b == true then wins = wins +1 end if wins > 0 then c = true end [/CODE]
Of course it does. You can also do even cooler stuff like this. [lua]local a , b , c = true , true , nil if a or b then c = true end print(c)[/lua]
Well, I just rewrote my last code and it worked... I guess, I'm just too tired... /tread
Sorry, you need to Log In to post a reply to this thread.