Page 3 of 3 FirstFirst 1 2 3
Results 21 to 24 of 24

Thread: Bank system script

  1. #21
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    You do not have to do so on Graal, since it's 1. An object oriented language, and 2. There are no defined types in Gs2, unlike Gs3.
    To consider an initial value, you can do this.height = 0; but definitely not this.height;
    -Johnaudi

  2. #22
    I just upgraded the flight script adding more controls and effects such as the bouncing/levitating effect.
    PHP Code:
    /* Hi, this script was made by Noof. on the TestBed server, 

    Press the 'O' Button to turn on, use the '+' and '-' to change your altitude.

    This script is kind of useless but other than that, enjoy!
    */

    //#CLIENTSIDE
    function onKeyPressed(codekey) {
       if (
    key == "o") {
          if (
    this.fly == "on") {
             
    player.-= this.height 3;
             
    sleep(.2);
             
    player.-= .3;
             
    sleep(.1);
             
    player.-= .3;
             
    sleep(.1);
             
    player.0;
             
    this.height 0;
             
    this.fly "off";
             
    player.chat "Flight -Off-";
             
    setTimer(0);
          } else {
             
    this.fly "on";
             
    player.chat "Flight -On-";
             
    setTimer(0.05);
          }
       }
       if (
    this.fly == "on") {
          if (
    code == 187) {
             if (
    this.height 5) {
                
    this.height += .5;
             }
             
    player.chat "Height: " this.height;
             if (
    this.height == 5) {
                
    player.chat "Maximum height reached!";
             }
             
    onCreated();
          }
          if (
    code == 189) {
             
    player.chat "Height: " this.height;
             if (
    this.height .1) {
                
    this.height -= .5;
             }
             if (
    this.height == 0) {
                
    player.chat "Can't go lower than this!";
             }
             
    onCreated();
          }
       }
    }

    function 
    onCreated() {
       
    this.height 0;  //JOHN Happy!?!? lmao
       
    if (this.fly == "on" && this.height && this.height 0) {
          
    player.this.height;
          
    setTimeout(0.05);
       }
    }

    function 
    onTimeout() {
       if (
    this.fly == "on") {
          
    player.+= .1;
          
    sleep(.1);
          
    player.+= .2;
          
    sleep(.1);
          
    player.+= .3;
          
    sleep(.15);
          
    player.-= .1;
          
    sleep(.15);
          
    player.-= .2;
          
    sleep(.1);
          
    player.-= .3;
          
    sleep(.1);
          
    setTimer(0.05);
       }
       
    onCreated();


    And John, I always looked at

    PHP Code:
    this.height
    As just creating the variable and setting it later, guess it would not be the same for graal thanks I changed it in the script specifically for you
    Noof was here.

  3. #23
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    PHP Code:
    this.height 0;  //JOHN Happy!?!? lmao 
       
    if (this.fly == "on" && this.height && this.height 0) { 
          
    player.this.height
          
    setTimeout(0.05); 
       } 
    But then, since height is 0, it is no longer less than 5 and bigger than 0, so this code cannot be executed =] haha

    Just remove the whole this.height = 0 line? Not really sure how your code works.
    -Johnaudi

  4. #24
    Ooooh you caught me! Never thought of it that way...

    Thanks yeah your right logically that would not work I could just change it to
    PHP Code:
       if (this.fly == "on" && this.height && this.height >= 0) { 
          
    player.this.height
          
    setTimeout(0.05); 
       } 
    The edit was >= that might not even work because if it equals 0 it will go in the negatives... fine you win,

    How was the code besides that? Also clear your damn inbox I wanna show you some cool stuff!
    Noof was here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •