Jump to content
shaba123

Attack more than one npc?

Recommended Posts

17 minutes ago, Tommm39 said:

NPC monsterToAttack = getNPCs().closest("Name 1", "Name 2", "Name 3", "Name 4", "Name 5");

if (monsterToAttack != null && monsterToAttack.interact()) {

}

small note its best to make the NPC monsterToAttack; in your class and when you use it in a method use monsterToAttack = getNPCs().closest("Name 1", "Name 2", "Name 3", "Name 4", "Name 5"); 

  • :???: 1
Link to comment
Share on other sites

On 5/16/2018 at 2:06 PM, TheMcPker said:

small note its best to make the NPC monsterToAttack; in your class and when you use it in a method use monsterToAttack = getNPCs().closest("Name 1", "Name 2", "Name 3", "Name 4", "Name 5"); 

If you are not using the NPC outside the method, there's no reason to do so.

Edited by Canidae
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...