So I am trying to set a variable to true when lever at 15 15 15 is powered and set the variable to false when lever is unpowered. And then pressing a button calls an if statement that checks if the var as mentioned before is true. If it is it calls a function. The button location is 12 12 12.
[doublepost=1623431027,1623421785][/doublepost]Note: This doesn't work for me
Code:
on rightclick on lever:
if distance between event-block and 15 15 15 is 1:
if {bombarmed} is true:
set {bombarmed} to false
else if {bombarmed} is false:
set {bombarmed} to true
on rightclick on button:
if distance between event-block and 12 12 12 is 1:
if {bombarmed} is true:
# calling function to activate bomb.