Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Grabbing of floor? (https://forums.graalonline.com/forums/showthread.php?t=78114)

Knightmare1 01-08-2008 04:47 AM

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



Chompy 01-08-2008 04:35 PM

in the script for the npc, is temp.dx, temp.dy setted? if not the item will be placed on 0,0..


All times are GMT +2. The time now is 04:34 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.