View Single Post
  #4  
Old 01-23-2007, 05:16 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
I did something similar a while ago.

I have a weapon script which creates an NPC using putnpc2. When that NPC is touched it triggers an action on the weapon NPC.


In the placed npc I just have triggeraction(0,0,"serverside","npc name",params);


I'm pretty sure that works,

if not, you can always use findweapon.

Master
NPC Code:

//#CLIENTSIDE
function onCreated(){
findweapon("Chompy/Test").trigger();
}




Chompy/Test
NPC Code:

function onActionServerside()
{
if ( params[ 0] == "actiontest")
echo( params[ 1]);
}
//#CLIENTSIDE
public function trigger() {
triggeraction(0,0,"serverside","Chompy/Test","actiontest");

}

__________________

Coming soon (Hopefully:P)
Reply With Quote