Azlier
Old World Ghost
- Reaction score
- 461
I would also remove the unit. Combined with yours, it's good.
library GetHost initializer Init
globals
private unit U
private player Host = null
endglobals
constant function GetHost takes nothing returns player
return Host
endfunction
private function Click takes nothing returns boolean
if Host == null then
set Host = GetTriggerPlayer()
call RemoveUnit(U)
set U = null
endif
return false
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
set U = CreateUnit(Player(15), 039;hfoo039;, 10000, 10000, 270)
call PauseUnit(U, true)
call TriggerRegisterUnitEvent(t, U, EVENT_UNIT_SELECTED)
call TriggerAddCondition(t, Condition(function Click))
call SelectUnit(U, true)
endfunction
endlibrary
private function Click takes nothing returns boolean
if Host == null then
set Host = GetTriggerPlayer()
endif
call RemoveUnit(U)
set U = null
return false
endfunction
private function Click takes nothing returns boolean
if Host == null then
set Host = GetTriggerPlayer()
call RemoveUnit(U)
set U = null
endif
return false
endfunction