December 8, 20169 yr I am attempting to make the bot flee if he is under attack by anything. I tried this: if ((myPlayer().getHealthPercent() < 100)){ return state.WALK_TO_BANK; But it doesn't have the desired effect, if hi gets hurt he still just does his thing. Any tips? Thanks!
December 9, 20169 yr isUnderAttack() checking if the health percent is below 100 will likely fail in most situations depending on your defence / whether the npc deals damage.
December 9, 20169 yr Author Check if your in combat or interacting with the NPC Thanks, that works! if ((myPlayer().isUnderAttack())){ return state.GTFO;
Create an account or sign in to comment