Zunarb Posted May 24, 2020 Share Posted May 24, 2020 I only started scripting some days a go and been struggling with an issue of how to make my player detect if there are other player nearby so it would get out and hop worlds. Now it will do that even if its alone and nobody is there so can someone help me out and tell me what is wrong with this? it seems that "(getPlayers().getAll().size() <= 1 && (dungeon.contains(myPosition())))" is always active even if the conditions are not met? private void getOut() throws InterruptedException { if (getPlayers().getAll().size() <= 1 && (dungeon.contains(myPosition()))) { sleep(500); getWalking().webWalk(exit); RS2Object ladder = getObjects().closest("Ladder"); ladder.interact("Climb-up"); Sleep.sleepUntil(() ->myPlayer().isAnimating(), 3000); log ("Hopping worlds"); getWorlds().hopToP2PWorld(); Sleep.sleepUntil(() ->(getWorlds().hopToP2PWorld()), 2000); } else { collect(); } } Quote Link to comment Share on other sites More sharing options...
D9BLADEE Posted May 24, 2020 Share Posted May 24, 2020 getPlayers().getAll().size() <= 1 will always be met as you count as a player in this method, <= is greater than or equal to 1 If you set this to < 1 then should work Quote Link to comment Share on other sites More sharing options...
Zunarb Posted May 24, 2020 Author Share Posted May 24, 2020 Okay i managed to make it eventually work ^^ Thanks tho! Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted May 25, 2020 Share Posted May 25, 2020 21 hours ago, D9BLADEE said: getPlayers().getAll().size() <= 1 will always be met as you count as a player in this method, <= is greater than or equal to 1 If you set this to < 1 then should work Might want to flip that operator (; > - greater than < - less than 1 Quote Link to comment Share on other sites More sharing options...
D9BLADEE Posted May 25, 2020 Share Posted May 25, 2020 8 minutes ago, BravoTaco said: Might want to flip that operator (; > - greater than < - less than 1 Quote Link to comment Share on other sites More sharing options...
Nbacon Posted May 25, 2020 Share Posted May 25, 2020 5 hours ago, D9BLADEE said: Don't feel bad. I still have to draw the alligator teeth. I'm 22 years old. Quote Link to comment Share on other sites More sharing options...