View Single Post
  #18  
Old 10-29-2013, 07:15 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 361
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
i just tested the following script in a local npc (putnpc2) and it worked fine -

PHP Code:
function onCreated() {
  
this.ani "grab";
  
setshape18080);
}

function 
onInitialize(temp.pobj) {
  
this.owner temp.pobj.account;
  
triggeraction(this..5this..5"Test"null);
}

function 
onPlayerChats() {
  if (
player.chat == "test") {
    
this.onInitialize(player);
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.setshape(18080);
}

function 
onActionTest() {
  
this.scheduleEvent(.05"ShowPoly");
  
this.chat ":D";
}

function 
onShowPoly() {
  
with(findimg(200)) {
    
polygon = {
      
this.5this.5,
      
this.5this.5,
      
this.5this.5,
      
this.5this.5
    
};
    
red green blue 0;
    
alpha .6;
    
layer 3;
  }



so im fairly confident its breaking either because of the timeout or because of whats happening in the timeout

unrelated but also note how 'scheduleEvent' invokes 'onShowPoly' from the parameter 'ShowPoly'

if all else fails then why not try setting a gani attr on serverside, then moving the poly script into the gani attr script?

npc -

PHP Code:
function onCreated() {
  
this.owner null;
  
this.ani "grab";
  
setshape116 516 5);
  
this.attr[5] = "polytest.gani";

polytest.gani -
PHP Code:
SCRIPT

function onPlayerEnters(){
  
with(findimg(200)) {
    
polygon = {
      
this.5this.5,
      
this.5this.5,
      
this.5this.5,
      
this.5this.5
    
};
    
red green blue 0;
    
alpha .6;
    
layer 3;
    
attachtoowner true;
  }
}

SCRIPTEND 
using 'attachtoowner = true;' will make the poly automatically follow the npc object as it moves
__________________
This signature has been deleted by Darlene159.

Last edited by Jakov_the_Jakovasaur; 10-29-2013 at 07:26 PM..
Reply With Quote