Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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(codeKey) {
  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 0key 4key++) {
      if (
keydown(key)) {
        
player.+= (vecx(key) * this.speed);
        
player.+= (vecy(key) * this.speed);
      }
    }
  }
  if (
this.mode == 0) {
    
hidingimage();
  }
  
setTimer(0.05);
}

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

function 
HidingImage() {
  
hideimg(200);
  
hideimg(201);

Attached Images
 
__________________
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 12:46 AM.


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