Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   yay spinning script! (https://forums.graalonline.com/forums/showthread.php?t=134256649)

Liberated 10-24-2009 06:33 PM

yay spinning script!
 
I didn't know how to get this to work with a for or while loop, as when playerdir == 3 the action is different, how do i make it work with a for loop?
PHP Code:

//#CLIENTSIDE
function onWeaponFired()

  if(
this.lol == 0)
  {
     
this.lol 1;
     
settimer(.5);
  }
  else if (
this.lol == 1)
  {
    
settimer(0);
    
this.lol 0;
  }
}

function 
onTimeOut()
{
  if (
player.dir <3)
  {
    
player.dir++;
    
settimer(0.05);
  }
  else
  {
    
player.dir -= 3;
    
settimer(0.05);
  }
  


edit: i now see i forgot some spaces here and there, please don't mention those.

cbk1994 10-24-2009 06:49 PM

I guess you could do something like

PHP Code:

for (temp.0100++) {
  
player.dir 4;
  
sleep(1);



Liberated 10-24-2009 06:59 PM

what does the % do?

edit: nvm i understand that now, but then it stops at the leftview.
which i already could accomplish with a for loop myself, and it should keep spinning, untill i stop it by pressing D again.

editedit: nvm i didn't understand how the loop worked.

PHP Code:

//#CLIENTSIDE
function onWeaponFired()

  if(
this.lol == 0)
  {
  
this.lol 1;
  
settimer(0.1);
  }
  else if (
this.lol == 1)
  {
  
settimer(0);
  
this.lol 0;
  }
}


function 
onTimeOut()
{
  for(
player.dir 0playerdir<4playerdir++)
  
sleep(0.1);
  
settimer(0.1);


thanks for the help. :)


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

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