progamerz Posted April 8, 2016 Share Posted April 8, 2016 Hello, i am trying to make my script stop if the OSBot Client username is not progamerz Tried this code but still logging out if(getClient().getUsername() != "progamerz" ){ log("Take permission from progamerz please."); this.stop(); } Quote Link to comment Share on other sites More sharing options...
Charlotte Posted April 8, 2016 Share Posted April 8, 2016 (edited) if and no else ? if(getClient().getUsername().equalsIgnoreCase("Char")){ log("Welcome"+ getClient().getUsername().toString() + "!" + "You are authorized"); } else { log("Welcome" + getClient().getUsername().toString() + "!" + "You're not authorized to use this script!"); stop(); } Edited April 8, 2016 by Charlotte Quote Link to comment Share on other sites More sharing options...
Apaec Posted April 8, 2016 Share Posted April 8, 2016 you have to use comparators with non-value types, namely .equals() in this case. try if(!getClient().getUsername().equals("progamerz") ){ log("Take permission from progamerz please."); this.stop(); } Quote Link to comment Share on other sites More sharing options...
progamerz Posted April 9, 2016 Author Share Posted April 9, 2016 (edited) if and no else ? if(getClient().getUsername().equalsIgnoreCase("Char")){ log("Welcome"+ getClient().getUsername().toString() + "!" + "You are authorized"); } else { log("Welcome" + getClient().getUsername().toString() + "!" + "You're not authorized to use this script!"); stop(); } you have to use comparators with non-value types, namely .equals() in this case. try if(!getClient().getUsername().equals("progamerz") ){ log("Take permission from progamerz please."); this.stop(); } Will try and let u know! EDIT : both working thanks! Edited April 9, 2016 by progamerz 1 Quote Link to comment Share on other sites More sharing options...