This is a script I made for my server so I could randomly make people say stuff if they annoyed me. Just for a bit of fun. It doesn't work, however, and I have no clue as to what is wrong with it. From everything I've learned it seems that it should work. Please help me if you have time, it would be greatly appreciated!
PHP Code:
function onWeaponFired() {
temp.acc.chat = temp.message;
}
function onPlayerChats() {
if(player.chat.starts=="/message " && temp.acc.account!="Graal780973") {
temp.message = player.chat.substring("/message ".length());
}
if(player.chat.starts=="/account " && temp.acc.account!="Graal780973") {
temp.acc = findplayer(player.chat.substring("/account ".length());)
}