Quote: "It's possible the global variable you are using losses focus."
Ched80 is on the right track. When the script runs, it will switch to that global variable called and then set the value according. It may not know what to do since you are trying to set the value in the middle of the script.
I would have done something like this using the "incvar" and "decvar", since I know the value will either be one or zero:
:state=0:hudreset,hudx=50,hudy=50,hudsizex=1680,hudsizey=881,hudimagefine=gamecore\huds\mascara.png,hudname=gm,hudhide=1,hudmake=display,state=1
:state=1:globalvar=77,setvar=0,state=2
:state=2,scancodekeypressed=34:hudshow=gm,loopsound=audiobank\music\breathing.wav,globalvar=77,incvar=1,etimerstart,state=3
:state=3,etimergreater=250,scancodekeypressed=0:etimerstart,state=4
:state=4,etimergreater=250,scancodekeypressed=34:hudunshow=gm,stopsound,globalvar=77,decvar=1,etimerstart,state=5
:state=5,etimergreater=250,scancodekeypressed=0:state=1
I have a 350+ line script for my inventory and this method works for me, so hopefully it should work for you.
Twitter: @NFoxMedia