JAG98 4 Share Posted December 1, 2020 In tutorial island. Wrote a script for attacking rats. Seems ALL the rats are null? Spoiler private void attackRat(){ log("Attacking rat"); if(getLocalPlayer().isInCombat()){ log("Still Attacking!"); sleepUntil(()-> !getLocalPlayer().isInCombat(), Calculations.random(1000, 2000)); } else{ log("Selecting rat"); NPC rat = NPCs.closest(npc -> npc != null && npc.getName().equals("Giant Rat")); log("Rat selected"); if(rat !=null){ log("Not null rat!"); if(rat.interact("Attack")){ sleepUntil(()-> !rat.exists(), Calculations.random(1000,2000)); } } } } Tried replacing NPC with GameObject. Still no change. Logs only shows "Attacking rat", "Selecting rat", "Rat selected" Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted December 1, 2020 Isn't it 'Giant rat'? Link to comment Share on other sites More sharing options...
JAG98 4 Author Share Posted December 2, 2020 9 hours ago, Pseudo said: Isn't it 'Giant rat'? Unbelievable! Big bruh moment! Thanks for pointing out! Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted December 2, 2020 Np, you silly rat. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.