toggling something using lua

Jammin'

NNNO WAY! I CAN'T BELIEEEEVE THIS!
another lua thing. but i couldnt get a definitive answer from the wiki on how to do this. maybe i was just looking in the wrong places. help would still be nice.
 
Depends on what are you trying to toggle, why are you trying to toggle it and what should happen when you toggle it.

Some examples, which could not be fit for whatever you are doing:
  • Are you trying to toggle a boolean?
    • var = not $
  • Are you trying to toggle a number that is either 0 or 1?
    • var = $ == 0 and 1 or 0
  • Are you trying to toggle a bit in a flag variable?
    • flagvar = $ ^^ MF_FLAG

The wiki only shows you how functionality and syntax that SRB2's Lua has added, it is not going to explain how to perform arithmetic and operations. There are Lua tutorials for that lol



You... really ought to elaborate your posts more.
 
Depends on what are you trying to toggle, why are you trying to toggle it and what should happen when you toggle it.
a followitem

You... really ought to elaborate your posts more.
well, for one thing, i didnt know there was so much you could do with lua. i just thought there was just one way.
 
Last edited:

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top