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
  #1  
Old 03-06-2009, 10:53 PM
Novice Novice is offline
Developer
Join Date: Dec 2008
Posts: 90
Novice is an unknown quantity at this point
Send a message via MSN to Novice
Timeout problem

I'm doing a simple Levitation script just for fun.
For some reason, everything except the timeout works.
Even when I change the name of the timeout to something like "onAir" and use "scheduleEvent(0.05,"Air",null);" or changing the name of the timeout to "Air" and using "sleep(0.05); Air();" it just won't work.
Here's what I've got. Also, I don't care if you use this on your own server, just give me credit.
PHP Code:
//Scripted by Novice
//#CLIENTSIDE
function onCreated() {
  
this.rep = {"walk","grab","pull","push","sit"};
  
this.air 0;
  
player.0;
  
setTimer(0.05);
}

function 
onWeaponFired() {
  if (
this.air == 0) {
    
this.air 1;
    for (
i=0i<this.rep.size(); i++)
      
replaceAni(this.rep[i],"idle");
  }
  else if (
this.air in {1,2}) {
    
this.air 0;
    for (
i=0i<this.rep.size(); i++)
      
replaceAni(this.rep[i],this.rep[i]);
  }
}

function 
onTimeOut() {
  if (
player.== && this.air != 0)
    
this.air 2;
  if (
player.== && this.air != 0)
    
this.air 1;
  if (
this.air == 1)
    
player.+= 0.05;
  else if (
this.air == 2)
    
player.-= 0.05;
  else if (
this.air == && player.0)
    
player.-= 0.05;
  
setTimer(0.05);

Is there anything that looks wrong in there?

Last edited by Novice; 03-06-2009 at 11:24 PM..
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 06:36 PM.


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