1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved How do I check if an npc is in combat?

Discussion in 'Developer Support' started by tztok, Sep 3, 2016.

  1. tztok

    Joined:
    Nov 7, 2015
    Messages:
    31
    Likes Received:
    5
    How do I check if a npc is in combat?

     
  2. Best Answer:
    Post #3 by zeepzoop, Sep 3, 2016
  3. Qosmiof2

    Qosmiof2 I've been called a god before.

    Joined:
    Aug 5, 2014
    Messages:
    3,212
    Likes Received:
    924
    getTarget != null
     
  4. zeepzoop

    Joined:
    Jul 20, 2016
    Messages:
    1
    Likes Received:
    0
    getHealthGauge()!=null is better because target could be if its talking/trading etc.

    Also sometimes the npc will be stuck behind a wall and not actually in combat, but will have a target.

    It depends on the specific use case, but generally this method is more reliable for standard combat scripts bots.
     

Share This Page

Loading...