I'm looking to click a button and run a bunch of lines of code and at the end update my variable so when I click the button the second time it runs some different lines of code. I tried this, but it's complaining about redeclaring the variable. What's the cleanest way to do a simple toggle where the state changes each time…
That did the trick, thank you! Here is the code that works for me. int $uvToggleChecker = !$uvToggleChecker; if ($uvToggleChecker == 1) print "UV checker map turned on."; if ($uvToggleChecker == 0) print "UV checker map turned off.";