Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-24-2009, 06:33 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
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.
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.
Reply With Quote
  #2  
Old 10-24-2009, 06:49 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I guess you could do something like

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

__________________
Reply With Quote
  #3  
Old 10-24-2009, 06:59 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
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.
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.

Last edited by Liberated; 10-24-2009 at 07:20 PM..
Reply With Quote
Reply


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 02:44 PM.


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