• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Would this work?...

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
930
Would this work?... ~Solved

Ok is this realy going to work, or will it crash the game???

JASS:
function AWSOMELOOP takes nothing returns nothing
    local unit u = GetEnteringUnit()
    local unit x
    call UnitApplyTimedLife(u,'BTLF',10.00)
    loop
        set x = u
        exitwhen x == null
        ~Actions here
        call TriggerSleepAction ( 0.25 )
        set x = null
    endloop
    set u = null
endfunction

JASS:
function Remove takes nothing returns nothing
    local unit u = GetDyingUnit()
    call RemoveUnit(u)
    set u = null
endfunction

The settings are i added an event if unit dies and when unit enters map

EDIT: Found out a way to do it :)

JASS:
function AWSOMELOOP takes nothing returns nothing
    local unit u = GetEnteringUnit()
    call UnitApplyTimedLife(u,'BTLF',10.00)
    loop
        exitwhen GetUnitState(u, UNIT_STATE_LIFE) <= 0
        ~Actions here
        call TriggerSleepAction ( 0.25 )
    endloop
    set u = null
endfunction

~Thread Solved
 
Status
Not open for further replies.
Top