adding a function to another NPC:
(note, -HolyAddHere is an existing weapon that i have got on my char)
PHP Code:
//#CLIENTSIDE
function onCreated()
{
("-HolyAddHere").onTestingTrigger = function()
{
player.chat = "b";
};
("-HolyAddHere").trigger( "TestingTrigger", "" );
}
another test:
<some npcs script>
PHP Code:
//#CLIENTSIDE
function onCreated()
{
("-HolyAddHere").BTestingTrigger = function()
{
player.chat = "b";
};
("-HolyAddHere").callFunction( "BTestingTrigger" );
}
<script of -HolyAddHere>
PHP Code:
//#CLIENTSIDE
public function callFunction( funcN )
{
(@ funcN)();
}
should work serverside and with TServerNPCs etc too
