Why the heck wont function onKeyPressed() { } work for me?
NPC Code:
function onKeyPressed(character)
{
if (character == "a") {
if (playerx in |this.x-2,this.x+3|&&playery in |this.y-4,this.y+3|) {
if (this.open==0) {
play("nextpage.wav");
this.open=1;
this.setx=0;
}
}
}
}
NPC Code:
function onKeypressed(character)
{
if (character == "z") {
setani("sit","");
}
if (character == "x") {
setani("grab","");
}
}
(2 Different NPCs)
Neither of them work. What the heck am I doing wrong?