Replies in a chat function

Hiya peoples! I haven't been on the GE forums in such a long time! Anyway I was wondering, how do I make it to where you type something in a text box and when you hit enter another actor replies depending on what you say? example. if I type in "Hi there!" then it will reply with a random variety like "Hi!" or "Hello." or "Why hello there, supa tails!" 
