Your code doesn't make any sense.
this.chat isn't a function. How would it know that what you really want is to append the random number to "this.chat" and read the value of that variable?
The best way is to just make an array.
PHP Code:
function onPlayerTouchsMe() {
temp.chats = {
"Hey",
"Hi",
"How",
"Are",
"You",
"To",
"Day?"
};
this.chat = temp.chats[int(random(0, temp.chats.size()))];
}
Somebody will probably post below me and point out that you can sort of use
randomString, so let me say preemptively to avoid that; it's not intended for arrays and has some pretty big issues when used with them.