Graal has used two main scripting languages to date: GScript 1 (GS1) and GScript 2 (GS2). We now exclusively use GS2, which is the newest (and much improved) scripting language. Tig won't accept your level upload unless your scripts are written in GS2.
Events like "playerChats" which use an if-statement are using a GS1 convention, which should be avoided in new code. It's simple to write it in GS2:
PHP Code:
function onPlayerChats() {
// the player said something
}
It sounds like you're just getting started, so I'd highly recommend you look at
Jer's excellent scripting guide. It's not completed, but the first few lessons are, and it's been very helpful to a lot of new scripters.
The property you're looking for is the player's chat; this is written simply as "player.chat":
PHP Code:
function onPlayerChats() {
echo(player.chat);
}
You're going to want to use an if-statement to see if the player said your special word.
PHP Code:
function onPlayerChats() {
if (player.chat == "my word") {
// perform whatever you want to do here
}
}
Again, I highly recommend reading Jer's guide as it will explain this and more to you. Note that any scripts you write in GS1 will not work in the offline level editor. To test them, you should upload the level to a server (you can
signup for Testbed if you aren't staff on any other servers).
edit: ziro beat me to it, but I'll leave this here as it provides a bit more info on getting started w/ GScript