View Single Post
  #4  
Old 09-02-2008, 03:36 AM
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
I would probably do something like

PHP Code:
function onCreated()
{
  
onTimeOut();
}
function 
onPlayerEnters()
{
  
onCreated();
}
function 
onTimeOut()
{
  if ( 
players.size() <= )
  {
    return;
  }
  
  
temp.pl findNearestPlayerthis.xthis.);
  
  if ( 
pl.x in this.2this.| && pl.y in this.2this.)
  {
    
pl.attack();
  }
  
  
setTimer.3 );

You could also have a system weapon like this:
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
setTimer0.05 );
}
function 
onTimeOut()
{
  
temp.ns findareanpcsplayer.1player.12);
  
  for ( 
temp.npc ns )
  {
    if ( 
npc.isSpike )
    {
      
player.attack();
    }
  }
  
setTimer0.05 );

and in the spike

PHP Code:
function onCreated()
{
  
this.isSpike true;
}
function 
onPlayerEnters()
{
  
player.addWeapon"-SpikeDetector" );
  
onCreated();

__________________
Reply With Quote