I am trying to trigger a function using level. vars like so:
*Npc1
PHP Code:
function onCreated() {
level.test = this;
this.testing = "Test";
}
public function Tri() {
this.chat = "Testing";
}
*Npc2
PHP Code:
function onPlayerTouchsme() {
level.test.Tri();
this.chat = level.test.testing;
}
Now, when I touch the second npc, its chat turns to 'Test'.
But the function Tri() in the first npc, is not triggered.
I tried doing level.test.trigger("Tri", nil); but still nothing.
The reason i'm doing it this way is so I don't have to rely on doing triggeraction() in a specific x, y.
This method works perfectly clientside...but I noticed npcs don't like being triggered this way serverside. :/