Resolved Clicking Players instead of NPCS

Discussion in 'Developer Support' started by torque0, Oct 31, 2015.

  1. It's definitely NOT just a missclick because the bot will continue to target the player multiple times before moving on to the actual target npc

    Code (Text):
    2. Npc npcm = Npcs.newQuery().names("Minotaur").results().nearestTo(Players.getLocal());
    Code (Text):
    1. if (npcm.getLevel() < 30) {
    2. if (npcm.interact("Attack")) {
    3. Execution.delayUntil(() -> npcm.getTarget() != null, 400, 1300);
    4. }
    5. }
    Anyone have a suggestion on how i can stop it doing this, even tried checking that the level was below 30 but its trying to attack any player, even those over 30
  2. Best Answer:
    Post #2 by Arbiter, Oct 31, 2015
  3. npcm.interact("Attack", npcm.getDefinition().getName())
    torque0 likes this.
  4. Thankyou!
  5. No problem. Are you in Dev Chat yet? Anyone in there could have answered that instantly. P.S. Make sure you null check definition.
  6. Didn't know such a thing existed but I have joined it :) , and i will thanks for the tip

Share This Page