I have this trigger, which when a specific crate is killed, the gate becomes vulnerable. The problem is that the gate won't be invulnerable before the crate dies. Do you know what I did wrong?
JASS:
//Noob-ish code...
scope LevelOne initializer InitTrig
globals
private destructable Crates = gg_dest_LTcr_0001
private destructable Gate = gg_dest_DTg7_0002
private timer T = CreateTimer()
endglobals
private function Update takes nothing returns nothing
if(GetDestructableLife(Crates) <= 0) then
call PauseTimer(T)
call BJDebugMsg("Gate is now vulnerable.")
call SetDestructableInvulnerable(Gate, false)
endif
endfunction
private function InitTrig takes nothing returns nothing
call SetDestructableInvulnerable(Gate, true)
call TimerStart(T, .01, true, function Update)
endfunction
endscope