• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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