PHP Code:
function onPlayerChats() {
if(player.chat.starts("/color")) {
temp.tokens = player.chat.tokenize();
if(tokens[1] == "red") {
//do something when player says "/color red"
} else if(tokens[1] == "blue") {
////do something when player says "/color blue"
}
}
}
I haven't scripted in like a year so, I hope I got that right x]