darkjack7 4 Posted April 28, 2016 i'm trying to make my script detect whether i have a ring of dueling on so i have tried this placed in the middle of a banking snippet if(getEquipment().contains(ring -> ring.getName().contains("dueling"))) { getBank().withdraw("Ring of dueling(8)"); } am i doing something wrong? thanks edit: it is withdrdawing the ring of dueling(8) but the problem is that i already had a ring of dueling(6) equiped
Zawy 1037 Posted April 28, 2016 ring -> ring.getName() !=null && ring.getName().contains("ring of ") !=null try that
Glitch 73 Posted April 28, 2016 Arent you currently checking if you have a ring equipped and if you do then you're withdrawing another.
Hopewelljnj 46 Posted April 28, 2016 Arent you currently checking if you have a ring equipped and if you do then you're withdrawing another. He's right. You need to put a ! in front of getEquipment() so it returns true only if one is not equipped. v if(!getEquipment().contains(ring -> ring.getName().contains("dueling"))) { getBank().withdraw("Ring of dueling(8)"); }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.