It has been a long time since I scripted anything in FPSC, but I see a few things I would change in that script...
Move the state=4 to the end of the line at line 7
Same thing with line 9 with state=7
Last line.... why have two state=3 actions? (I would get rid of the first one so that all the actions moving to other states appear last for continuity)
I think the problem may be in state 4...
:state=4,varnotequal=FLASH 0,keypressed=33 0:state=7,etimerstart
:state=4,varnotequal=FLASH 0:etimerstart,state=5
If you are not pressing the key, then you go to state 7 before the other line gets checked.
The other line is essentially the same condition, because the key is not pressed in that line either.
I am really rusty because I have not used FPSC for several years now (been banging away at AGK), so bare with me as I slowly examine this and try to help.
try this
:state=0:dimvar=FLASH,dimvar=FON
:state=0:hudreset,hudglobalx,hudglobaly,hudx=50,hudy=50,hudimagefine=languagebank\english\gamecore\huds\FlashHUD\flashHD.dds,hudname=FLIGHT,hudhide=1,hudmake=display,state=1
:state=0:hudunshow=FLIGHT,state=1
:state=1:setvar=FLASH 10,setvar=FON 0,state=3
:state=3,varnotequal=FLASH 0,keypressed=33 1,varequal=FON 0:setvar=FON 1,sound=audiobank\flashswitch\flash.ogg,ambience=100,hudshow=FLIGHT,state=8
:state=4,varnotequal=FLASH 0,keypressed=33 1:etimerstart,state=7
:state=4,varnotequal=FLASH 0:etimerstart,state=5
:state=4,varequal=FLASH 0:etimerstart,state=7
:state=5,etimergreater=1,varequal=FLASH 0:state=7
:state=5,etimergreater=1000,varnotequal=FLASH 0:subvar=FLASH 1,state=4
:state=7,etimergreater=100,keypressed=33 0:sound=audiobank\flashswitch\flash.ogg,setvar=FON 0,ambience=0,hudunshow=FLIGHT,state=3
:state=8,keypressed=33 0:state=4
, as you can see I added a state=8 that checks for the key release before moving to state=4
Then, in state=4 I changed your keypressed to a 1 to detect a second press for the toggle.
I also added a keypressed 0 to check for a key release in state 7 too since we pressed in state 4 to get there
Not sure if this will work, because I am not able to test, and I usually write my own sripts, so editing yours is hard when I have been away this long, but maybe we'll get lucky.
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1