Basically, I'm trying to make a piston door that is activated by a lever (and an elevator), and what I want is to be able to switch on a lever, which will set a red stone block behind the pistons, then when it's switched off, to summon air behind them.
However the best I could get was a repeat one with the red stone command attached to a chain with the air one and it created some spooky demonic piston doors (the red stone block was flashing while being reset so fast)
So like is there a way that I can set the pistons to activate (or the redstone block to be set) when the lever is turned on, and to replace it with air when it is switched off? I have been having trouble trying to find anything that is remotely close to what I'm trying to do for info. Hopefully I can get some help here, thanks!