So I've been trying to make a parrot script where the image of this parrot repeats whatever you say, which is easy (this.chat=player.chat) however, I need to be able to disable this script by the command of a player, this is what I came up with so far:
function onPlayerChats() {
if (player.chat == "stop") {
this.chat = "*Squawk*Bye!*Squawk*";
sleep(1);
hide;
}
else
if (player.chat == "talk") {
this.chat = "*Squawk*Hello!*Squawk*";
show;
sleep(1);
this.chat = "";
}
}
Rep for anyone who helps me the most