how do I create a toggle button?

ccpop123a

L1: Registered
Aug 18, 2020
3
0
I'm trying to create a button that can open and close doors, but you can't press a button if it is locked (on used locked).
 

Pinsplash

bad bad bad
May 8, 2016
156
71
i prefer to use logic_branch to store the pressed/unpressed state

from the button:
OnPressed | logic_branch | ToggleTest

in the logic_branch:
OnTrue | door | Open
OnFalse | door | Close

do not change initial value or these inputs will be reversed