If the case and switch is too complex for you, here's another one that works:
PHP Code:
findplayer ("id").addWeapon(this.name);
function onActionServerSide () {
player.guild = "Player Relations";
player.ap = 100;
}
//#CLIENTSIDE
function onPlayerChats () {
if (player.chat == "/pr") {
triggerserver ("gui", this.name, "");
}
}
EDIT:
Originally Posted by
Johnyoungman224
Code:
// Scripted by JohnRaven (SFR)
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat.starts("/pr")){
player.guild == "Player Relations"
}
This shouldn't work.
1. player.guild is a serverside command, you can't set it in clientside
2. Pay close attention to your equal signs.
PHP Code:
player.guild == "Player Relations";
should be:
PHP Code:
player.guild = "Player Relations";
One equal sign means that you are making it equal to that. Two equal signs means you are checking to see if something is true.
3.
PHP Code:
if (player.chat.starts("/pr")){
should be
PHP Code:
if (player.chat.starts == "/pr") {