Jump to content

Attack more than one npc?


Recommended Posts

Posted
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"); 

Posted (edited)
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...