function onPlayerChats(){ temp.txt = player.chat.tokenize()[0]; switch (txt){ case "test": // or case "("test")": // bla bla bla break; } }