Bronxernijn
You can change this now in User CP.
- Reaction score
- 43
Dear people, I tried something using the last created unit. All the code does is run the init function, it never gets to the second. What did I do wrong?
JASS:
scope unitPlus initializer init
function try takes nothing returns nothing
call DisplayTextToPlayer(Player(0), 0, 0, "Success!")
call CreateUnit(Player(0), 039;hfoo039;, 30, 30, 0)
endfunction
function init takes nothing returns nothing
local trigger t = CreateTrigger()
local unit u
call CreateUnit(Player(0), 039;hfoo039;, 0, 0, 0)
set u = bj_lastCreatedUnit
call TriggerRegisterUnitEvent(t, u, EVENT_UNIT_SELECTED)
call TriggerAddAction(t, function try)
endfunction
endscope