Thread Tools Display Modes
06-22-06, 06:34 AM   #1
macros
A Defias Bandit
Join Date: Jun 2006
Posts: 2
Question Noob question: How to trigger a script on my target's death?

I want my addon to trigger when my target dies. Which event should I use for that? I tried

Code:
function ComboWaste_OnEvent() 
    if (event == "UNIT_HEALTH") and (arg1 == "target") then 
        if(UnitIsDead("target")) then
            blahblah();
        end
    end 
end
and

Code:
<OnEvent> 
    if (event == "VARIABLES_LOADED") then  
        ComboWaste_initialize(); 
    end 
    ComboWaste_OnEvent(); 
</OnEvent>
But this doesn't really seem to work. I'm new at this, so forgive me if I made some stupid mistake or if the whole thing doesn't make any sense at all. =)
  Reply With Quote
06-22-06, 03:59 PM   #2
macros
A Defias Bandit
Join Date: Jun 2006
Posts: 2
Never mind, i got it to work...
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Noob question: How to trigger a script on my target's death?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off