View Single Post
  #2  
Old 03-03-2007, 06:53 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
THANKS SO MUCH GAMBET! NOW you must read my PM ;P
Also, I put it in my server and found an error. We don't want it at speed 0, so here's a revision:
PHP Code:
//Custom staff boots system
//By: Gambet
//Controls:
//  + and = key (left of backspace on American keyboard) - plus speed
//  - and _ key (left of + and = key on American keyboard) - minus speed
//  z key = toggle on/off
//  Max Speed: 10

//#CLIENTSIDE
function onKeyPressed(code,key)
{
 if (
key == "z")
  {
   if (
this.staff_boots == "on")
    {
      
this.staff_boots this.speed "";
      
player.chat "Staff Boots -Off-";
      
setTimer(0);
    } else
     {
       
this.staff_boots "on";
       
player.chat "Staff Boots -On-";
       
setTimer(0.05);
     }
  }
 if (
code == 187)
  {
   if (
this.speed+<= 10)
    {
     
this.speed+=1;
     
player.chat "Speed: " this.speed;
    }
  } else if (
code == 189)
   {
    if (
this.speed->= 1)
     {
      
this.speed-=1;
      
player.chat "Speed: " this.speed;
     }
   }
}

function 
onTimeOut()
{
 if (
this.staff_boots == "on")
  {
   for (
a=0a<4a++)
    {
     if (
keydown(a))
      {
       switch(
a)
        {
          case 
"0":
           
player.y-=this.speed;
           break;
          case 
"1":
           
player.x-=this.speed;
           break;
          case 
"2":
           
player.y+=this.speed;
           break;
          case 
"3":
           
player.x+=this.speed;
           break;
        }
      }
    }
  }
 
setTimer(0.05);

But the error with THAT is that it STARTS at speed 0, then you ahve to press + (or = ) before it actualy is USABLE to move around on walls and stuff.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 03-03-2007 at 07:26 PM..
Reply With Quote