View Single Post
  #3  
Old 05-26-2009, 11:39 PM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 904
Default

Just tested this script:

Code:
sub EVENT_SPAWN {
  my $x = $npc->GetX();
  my $y = $npc->GetY();
  quest::set_proximity($x - 15, $x + 15, $y - 15, $y + 15);

 $enter_count = 0;  #Keep track of how many characters enter the proximity.
}

sub EVENT_ENTER {

$enter_count = $enter_count + 1;
quest::shout("1");

  if ($enter_count > 1) {
    quest::shout("No more than 1 at a time may do this encounter.");
    quest::movepc(241, 0, 0, 20);
  }
  
sub EVENT_EXIT {

$enter_count = $enter_count - 1;
quest::shout("2");

}

}
The NPC shouts 1 when PC 1 enters. When PC 2 enters he shouts 1, then kicks PC 2 out, then shouts the "No more blahblah."

I also had my PC run up to him and just die. When I died he shouted 2, which means he drops count when a player dies.
Reply With Quote