Thread: Speed Sandals
View Single Post
  #1  
Old 09-24-2011, 07:05 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Speed Sandals

Just another staff boot script, but with a difference that I hope the users will find quite pleasant. It has an image / text display in the top right corner of your screen that shows your speed. You can increase speed by pressing + and otherwise decrease it by pressing -. Here is the script.
PHP Code:
//#CLIENTSIDE
function onKeyPressed(code, Key) {
  if (
Key == "z") {
    
setTimer(0.05);
    if (
this.mode == 0) {
      
this.mode = 1;
      
this.speed = 1;
    } else {
      
this.mode = 0;
    }
  }
  if (
Key == "=") {
    
this.speed = this.speed + 1;
  }
  if (
Key == "-") {
    
this.speed = this.speed - 1;
  }
}

function 
onTimeout() {
  if (
this.mode == 1) {
    
showingimage();
    for (
temp.key = 0; key < 4; key++) {
      if (
keydown(key)) {
        
player.x += (vecx(key) * this.speed);
        
player.y += (vecy(key) * this.speed);
      }
    }
  }
  if (
this.mode == 0) {
    
hidingimage();
  }
  
setTimer(0.05);
}

function 
ShowingImage() {
  
with(findimg(200)) {
    
image = "wboots.png";
    
layer = 4;
    
x = screenwidth / 2 - 675;
    
y = screenheight - 610;
  }
  
with(findimg(201)) {
    
text = "Speed: " @ thiso.speed;
    
x = screenwidth / 2 - 638;
    
y = screenheight - 601;
    
zoom = 0.7;
    
layer = 4;
    
style = "bi";
    
textshadow = true;
    
font = "Tempsitc";
  }
}

function 
HidingImage() {
  
hideimg(200);
  
hideimg(201);
} 
Attached Images
 
__________________
Reply With Quote