View Single Post
  #4  
Old 10-01-2006, 02:58 AM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by xXziroXx
Why is this in the GS2 forum?
It can be here now.

PHP Code:
//#CLIENTSIDE

//This part will make the NPC automatically block for the character. You'll want this to be clientside, unless you're wanting the door to be opened for every person at once.
function onCreated(){
  
blockagain;
  
show;
}

//This will check to see if the player has killed all of the NPCs. However, I'd urge you to try something harder, like a key requirement or something similar.
function onCompusdead(){
  
dontblock;
  
hide;

Also, here's an example door that uses multiple keys to open:
PHP Code:
//#CLIENTSIDE

//This function is used on the actual door itself. The door requires 7 keys to unlock. That's pretty ridiculous, but it's also hilarious.
function onCreated()
{
  if(
doorkeys==7)
   {
    
dontblock;
    
hide;
   }
  else
   {
    
block;
    
show;
   }
}

//Call this function on every Key NPC you make that corresponds with this door. This should not be used in conjunction with the above code.

//#CLIENTSIDE

function onPlayertouchsme()
{
  
//Add whatever function you use to add stuff to your inventory / mudlib here.
  
doorkeys+=1;
  
destroy;


Last edited by Draenin; 10-01-2006 at 03:26 AM..
Reply With Quote