Quote:
Originally Posted by coreys
On Uprising we are using a class for dropped items. It's joined with putnpc2. But, we need to use triggeraction, but we can't get them to work the way you use them in weapons. Can anyone tell me how to use triggeractions in classes joined to npcs layed with putnpc2? Oh, and in normal NPCs as well.
|
For future reference, you trigger to the serverside in class npcs the same you would in a level
PHP Code:
triggeraction(setanx,setay,"action",params);
EXAMPLE:
PHP Code:
function onActionTest() {
player.chat = "You just triggered! =)";
}
//#CLIENTSIDE
function onCreated {
triggeraction(x+0.5,y+0.5,"test","");
}
The format is different from the way it's set up for weapon npcs. Also take note that everything you put in the params will start with params[0] and not params[1].