|
anyything in a line past two forward slashes is just a comment, and does not affect the script.
// this is a comment
so, take a look at the following script. when it is "created" it sets this.enabled to true.
When a player says "birdie!" this.enabled is set to the negation of itself.
That setting of the negation is what causes the the toggling between the parrot repeating mode 'On' and 'Off'.
Whenever the player says something that is not "birdie!", it checks if this.enabled is true.
If that checks out, it repeats what the player says.
function onCreated() {
this.enabled = true;
}
function onPlayerChats() {
if (player.chat == "birdie!") {
// enable or disable here
this.enabled = !this.enabled;
} elseif (this.enabled) {
// if its enabled, repeat what player says
this.chat = player.chat;
}
}
|
i kinda see what youre saying...but i dont know what to put in the enable and disable section. i want to make it so there are two commands: stop and speak
and i dont know where in the script it represents this...
sorry if you have put it all in i just have not learned this far into gs2