Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #35  
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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.