View Single Post
  #1  
Old 12-28-2010, 07:48 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Triggering a function

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. :/
__________________

Reply With Quote