December 18, 201510 yr How to check if npc is within 1 tile away from me? NPC cow = getNpcs().closest("Cow"); if(cow.getPosition().distance(myPosition()) <= 1) // do something
December 18, 201510 yr NPC cow = getNpcs().closest("Cow"); if(cow.getPosition().distance(myPosition()) <= 1) // do something Wouldn't you need to have the get position function on your player?
December 18, 201510 yr Wouldn't you need to have the get position function on your player? myPosition() Just does: myPlayer().getPosition() Decompiled myPosition() declaration: Edited December 18, 201510 yr by Explv
December 18, 201510 yr myPosition() Just does: myPlayer().getPosition() Decompiled myPosition() declaration: What ide skin is that?
December 18, 201510 yr getMap().realDistance(cow.getPosition()); getMap().distance(cow.getPosition());
December 20, 201510 yr Author NPC cow = getNpcs().closest("Cow"); if(cow.getPosition().distance(myPosition()) <= 1) // do something This is perfect. Big thanks!
Create an account or sign in to comment