Just_kill
New Member
- Reaction score
- 0
How do I create an illusion with triggers?
function CloneUnit takes unit u, location loc returns unit
local gamecache cloneunit = InitGameCache("CloneUnit")
call StoreUnit(cloneunit, "Clone", "ClonedUnit", u)
set bj_lastCreatedUnit = RestoreUnit(cloneunit, "Clone", "ClonedUnit", GetOwningPlayer(u), GetLocationX(loc), GetLocationY(loc), GetUnitFacing(u))
call FlushGameCache(cloneunit)
set u = null
call RemoveLocation(loc)
set loc = null
return bj_lastCreatedUnit
endfunction