Im trying to do a script where if someone with a staff level 2 or higher says "/kill <account>" it does so.
The script worked before I added the staff level requirement. Also can you show me where i would add an else statement for those who aren't level 2 or higher? I am trying to make it say "Not Allowed". At one point it was making my text "Not Allowed" no matter what i said unless i said "/kill <account>" so i think i was close.
PHP Code:
function onActionServerSide(tokens){
if (tokens[0] == "/kill") {
temp.pl = findPlayerByCommunityName(tokens[1]);
temp.pl.hearts = 0;
temp.pl.chat = player.account SPC "killed you!";
player.chat = "You killed" SPC temp.pl SPC "!";
}
}
//#CLIENTSIDE
function onPlayerChats() {
if(tokens[0] == "/kill" && (player.clientr.stafflvl) > 1) {
temp.tokens = player.chat.tokenize();
triggerServer("gui", this.name, tokens);
}
}