It's probably better do do something like this:
PHP Code:
function onCreated() {
level.door = this;
this.hidden = false;
}
function onOpen() {
if (! this.hidden) {
return;
}
this.hidden = true;
hide();
scheduleevent(3, "Show");
}
function onShow() {
this.hidden = false;
show();
}
and then in the other script
PHP Code:
function onPlayerTouchsMe() {
if (level.door.hidden) {
return;
}
level.door.trigger("Open");
}
Notice I'm putting the actual NPC object in a level variable, not the x and y. This ensures that you'll always get to that NPC, even if there's another NPC on top of it, which could cause problems when using triggeraction.