chat is a variable of player.
player.chat = "hai!!"; will show hai!! over a player.
Can also do stuff like
PHP Code:
function onPlayerChats()
{
if (player.chat == "hai!")
this.chat = "hai2u!";
}
Also, if you are trying these code in Editor.exe you should warn us as GS2 does not work in Editor as of yet.