PHP Code:
function onCreated()
{
setImg( this.img );
setShape( 1, 16*2, 16*2 );
this.spawnpoints={{ 1,5 },{ 8,2 },{ 9,1 },{ 12,62 },{ 12,6 },{ 15,73 },{ 51,52 }};
this.random=int(random(0,this.spawnpoints.size()+1));
}
function onActionGrabbed()
{
findPlayer( params[ 0] ).addWeapon( this.weapon );
hide;
sleep(540);
setlevel2("final_gmap.gmap",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";
}
*/
this works?