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 03-03-2007, 06:45 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
For Switch and whoever: Staff Boots

As requested in this thread:
http://forums.graalonline.com/forums...ad.php?t=72559

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->= 0)
     {
      
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);



Made it in like 5 minutes so yeah, do with it as you please. Everyone is open to use it, though there are plenty of boot scripts out there for those of you that don't know how to script -- just add this one to the list!


Though you shouldn't get into the habit of just taking peoples scripts without at least bothering to learn the basics of GScript. It sort of defeats the purpose.


Regardless, enjoy!


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


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