The scary thinker had exactly the solution I wanted!!! But I need help with two things here, first its irritating that the numerics shows when Im on land.. And I want to remove the hud when on land, and show it in the water....
I also wonder why this hud is not showing at all: :state=0:hudreset,hudx=25,hudy=5,hudimage=languagebank\english\gamecore\huds\air.dds,hudtype=1,hudmake=display
And I cant even move the number "numerics" to My new hudimage (That shourld remove when not diving)
;Artificial Intelligence Script
;Header
desc = breathing underwater
;Triggers
:state=0:dimvar=usinghelm
:state=0:water=1,waterfogdist=500,waterred=210,watergreen=230,waterheightofzone=180
:state=0:dimlocalvar=breath,dimlocalvar=breathmax,setvar=breathmax 1000,dimlocalvar=timerstarted,dimlocalvar=underwater,setvar=breath %breathmax
:state=0:hudreset,hudx=25,hudy=5,hudimage=languagebank\english\gamecore\huds\air.dds,hudtype=1,hudmake=display
:state=0:hudreset,hudx=24,hudy=8,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\numeric1.tga,hudname=breathing,hudtype=6,huduservar=breath,hudmake=numeric,state=1
;Handle the deacrease of air
:state=1,varequal=underwater 1,vargreater=breath 1:etimerstart,setvar=underwater 2,setvar=timerstarted 0
:state=1,varequal=underwater 2,vargreater=breath 1,etimergreater=250:subvar=breath 10,etimerstart,setvar=underwater 1,setvar=timerstarted 0
;Out of air
:state=1,varequal=underwater 1,varless=breath -1:setvar=breath 0,setvar=timerstarted 0
:state=1,varequal=underwater 1,varequal=breath 0,etimergreater=1000:etimerstart,plraddhealth=-10,setvar=timerstarted 0
;Refill air
:state=1,varnotequal=breath %breathmax,varequal=underwater 0,varequal=timerstarted 0:setvar=timerstarted 1,etimerstart
:state=1,varnotequal=breath %breathmax,varequal=underwater 0,varequal=timerstarted 1,etimergreater=200:addvar=breath 35,setvar=timerstarted 0
:state=1,vargreater=breath %breathmax,varequal=underwater 0:setvar=breath %breathmax
;If the player dies reset our variables
:plralive=0:setvar=underwater 0,setvar=breath %breathmax,setvar=timerstarted 0,state=1
;Toggle our underwater variable
:plrunderwater=1,varequal=usinghelm 0,varless=underwater 0:setvar=underwater 1,stopsound
:plrunderwater=0,vargreater=underwater 1,vargreater=breath 101:setvar=underwater 0
:plrunderwater=0,vargreater=underwater 1,varless=breath 100:setvar=underwater 0,plrsound=audiobank\water\gaspforair.wav
;End of Script