Sorry, Gladius. I was tied up the last couple of days.
The script works properly. Let me explain what I do. Here is an example level screenshot:
I assign my hurtzone main script as:
;Artificial Intelligence Script
;Hurt Zone script
;Header
desc = plr gets hurt in zone when globalvar#77 == 0
;Triggers
:state=0:globalvar=77,state=1
:state=1,plrwithinzone=1,varequal=0:plraddhealth=-1
;End of Script
I assign my trigger main script this script:
;Artificial Intelligence Script
;Gas Mask script
;Header
desc = gas mask script with global variable
;Triggers
:state=0:globalvar=77
:state=0:setvar=0
:state=0:hudreset,hudx=50,hudy=50,hudsizex=1680,hudsizey=1050,hudimagefine=gamecore\huds\gasmask.png,hudname=mask,hudhide=1,hudmake=display,state=1
:state=1,scancodekeypressed=33:hudshow=mask,state=2,setvar=1
:state=2,scancodekeypressed=0:state=3
:state=3,scancodekeypressed=33:hudunshow=mask,state=4,setvar=0
:state=4,scancodekeypressed=0:state=1
;End of Script
When I start and enter the hurt zone, my health starts to lower. I press the key for the gasmask, the hud comes up and I no longer get hurt. I walk to the other side and press the key to turn off the mask. I turn around and re-enter the hurt zone, I get hurt. I press the key for the mask and I do not get hurt when the mask hud appears.
I've tested with different variations: mask on, enter hurt zone, leave hurt zone, re-enter hurt zone. I tried mask off, enter hurt zone, put mask on and I was protected, leave hurt zone, turn mask off, re-enter hurt zone, get hurt, mask on, protected.
BTW I'm running this in FPSC v1.17 and it works exactly as it should.
- BlackFox

RPG Mod- Create a world full of adventure