View Single Post
  #41  
Old 01-08-2008, 04:47 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
its still not working. and for some odd reason neither are my tiles...

here is code:
PHP Code:
function onCreated()
{

  
setImgthis.img );
  
setShape116*216*);
  
this.spawnpoints={{ 1,},{ 8,},{ 9,},{ 12,13 },{ 12,},{ 15,43 },{ 51,52 }}; 
  
this.random=int(random(0,this.spawnpoints.size()+1));

}

function 
onActionGrabbed()
{

  
findPlayerparams0] ).addWeaponthis.weapon );
  
hide;
  
sleep(540);
  
warpto("final_osl.nw",this.spawnpoints[this.random][0],this.spawnpoints[this.random][1]);
  
show;
}

/*The script for NPC.

temp.n = putnpc2( temp.dx, temp.dy, "" ); 
with ( temp.n ) 


  join( "flooritem" ); 
  this.img = "icon.type"; 
  this.weapon = "Weapon/Name"; 

}

*/ 
code for system weapon:
PHP Code:
//#CLIENTSIDE
function onKeyPressedcodekey)
{

  switch ( 
temp.code)
  {
  
    case 
"65"//a
      
Grab();
    break;
    
  }
}

function 
Grab()
{

  
frontPosition = { player.1.5 vecx(player.dir) * 2player.1.5 vecy(player.dir) * 2};
  
  
canGrab = ( testplayer(frontPosition[0], frontPosition[1]) || testnpc(frontPosition[0], frontPosition[1]));

  if ( 
canGrab)
    
triggerAction(frontPosition[0], frontPosition[1], "Grabbed"player.accountplayer.guild);

__________________
I am the devil, I am here to do to devils work.
Reply With Quote