The way I make values that toggle goes like this.
Sprite-- set value to-- 1 - Sprite.value('value')
With this the value will always be 1 or 0, so you can set the visibility to 1=on 0=off. Or doors 1=open 0=closed, etc. Very handy to keep this one in mind.