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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.