Are you trying to run the script on the same client that's sending the message? If so, that's why it's not working. You can't activate your own on text events. You have to get someone else to send the message, or put the code on a different client.