Thread: Npc to Npc
View Single Post
  #48  
Old 02-18-2011, 05:14 AM
kingcj kingcj is offline
Registered User
kingcj's Avatar
Join Date: Apr 2006
Location: TN
Posts: 114
kingcj will become famous soon enough
Send a message via MSN to kingcj
Ok so the main reason I was trying to use a public function was to make sure that the script could be done clientside. Here is what I am working with now. It works, once but not twice, and is very very slow. Any pointers here would be great

The Switch:
PHP Code:
//#CLIENTSIDE
function onCreated() { 
  
this.switchid "door_2"
  
this.image "block.png"


function 
onPlayerenters() {
  
onTimeOut();
}

function 
onTimeOut() {
  if (
players.size() > 0
    
setTimer(0.1);
    else 
    
setTimer(0);
  for (
temp.findareanpcs(this.x-2this.y-222)) {
    if (
temp.i.isinclass("bomb")) 
      
SwitchDB.door.(@this.switchid).trigger("DoorOpened"null);
      
sleep(3.2);
      
onTimeOut();
     }

And the Door:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.doorid "door_2";
  
this.image "door.png";
  
SwitchDB.door.(@this.doorid) = this;
}

function 
onDoorOpened() {
  
hide();
  
sleep(3.15);
  
show();

__________________
Zie

"It is not necessary to change. Survival is not mandatory." - W. Edwards Deming
Reply With Quote