View Single Post
  #3  
Old 06-11-2009, 06:30 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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.
__________________
Reply With Quote