Code:
function Mensaje takes nothing returns nothing
if GetUnitTypeId(GetLastCreatedUnit())=='Harf' then
call BJDebugMsg("Arthas")
endif
endfunction
function Spawn_Unidad takes nothing returns nothing
call CreateUnit(Player(0),'Harf',GetLocationX(GetRectCenter(GetPlayableMapRect())),GetLocationY(GetRectCenter(GetPlayableMapRect())),270)
call Mensaje()
endfunction
function InitTrig_Trigger takes nothing returns nothing
local trigger Trigger2 = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(Trigger2, 2.00)
call TriggerAddAction(Trigger2, function Spawn_Unidad)
endfunction
its pretty simple though i cant make the message appear, and i couldnt make it work with GetUnitName