- Joined
- Nov 30, 2007
- Messages
- 1,202
JASS:
private function OnDamage takes nothing returns boolean
local timer t
local unit damaged = GetTriggerUnit()
if LoadUnitHandle(hash, GetHandleId(damaged), 1) == null then
set t = CreateTimer()
call SaveTimerHandle(hash, GetHandleId(damaged), 1, t)
call SaveUnitHandle(hash, GetHandleId(t), 1, damaged)
call TimerStart(t, DURATION, false, function OnTimerEnd)
else
set t = LoadTimerHandle(hash, GetHandleId(damaged), 1)
call TimerStart(t, DURATION, false, function OnTimerEnd)
endif
return false
endfunction
It doesn't apear to reset the timer, must i first pause then destroy then create a new one, and then finally save the new timer? :>
Solved it without using a timer. But still intrested in what one has to do to reset a timer.
Last edited: