its still not working. and for some odd reason neither are my tiles...
here is code:
PHP Code:
function onCreated()
{
setImg( this.img );
setShape( 1, 16*2, 16*2 );
this.spawnpoints={{ 1,5 },{ 8,2 },{ 9,1 },{ 12,13 },{ 12,6 },{ 15,43 },{ 51,52 }};
this.random=int(random(0,this.spawnpoints.size()+1));
}
function onActionGrabbed()
{
findPlayer( params[ 0] ).addWeapon( this.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 onKeyPressed( code, key)
{
switch ( temp.code)
{
case "65": //a
Grab();
break;
}
}
function Grab()
{
frontPosition = { player.x + 1.5 + vecx(player.dir) * 2, player.y + 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.account, player.guild);
}