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;
}