i'm having problem with LoadUnitHandle, why it does not work?
JASS:
function CallBack takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(udg_kbhs, GetHandleId(t), 0)
call KillUnit(u)
call BJDebugMsg("!")
endfunction
function SHActions takes nothing returns nothing
local unit c
local timer tm
if ( GetSpellAbilityId() == 'Iky0' ) then
set c = GetTriggerUnit()
set tm = CreateTimer()
call SaveUnitHandle(udg_kbhs, GetHandleId(tm), 0 , c)
call TimerStart(tm,5,false,function CallBack)
endif
endfunction
function InitTrig_SH takes nothing returns nothing
local trigger b = CreateTrigger ()
call TriggerRegisterAnyUnitEventBJ( b, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( b, function SHActions )
set b = null
endfunction