Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 24

Thread: Bank system script

  1. #11
    Good job, I was on earlier and just realized I got banned I wonder why :/

  2. #12
    Player Relations Toshihiro Kijima's Avatar
    Join Date
    Jul 2013
    Location
    Japan
    Posts
    1,132
    Nice bank system script Noof

  3. #13
    so is it from your own server? when your server will be opened message me, i would like to see it


    IGN: SashaGryg/Skype: sashagrygprovych
    Ask for help and you will receive

  4. #14
    Player Relations Toshihiro Kijima's Avatar
    Join Date
    Jul 2013
    Location
    Japan
    Posts
    1,132
    Quote Originally Posted by SashaGryg View Post
    so is it from your own server? when your server will be opened message me, i would like to see it
    The server Testbed - is where you learn script or improve your scripting skills more further.

    Here's the link - http://www.graalians.com/forums/showthread.php?t=27226

    Check this link above - if you want to learn script or improve and - wants an access to the server.

  5. #15
    Hi! I recently made a very simple but fun script, it is called the pinger (it does not actually ping your internet, messing with your IP could get me in trouble lol)
    What does it do?

    1). It changes your and the Graal ID that you are pinging.
    2). It has on/off
    3). Very interactive
    4). The person you ping will fly for a second and come back down.
    5). This is a pretty basic idea but I did run into some trouble on the way, expect either a taylor script or a flight script next
    Take a look!

    PHP Code:
    /*
    Press the 'O' button on your key board to turn on!
    Type in ':ping graal#' to use only when it is on though.
    Enjoy!
    */
    //#CLIENTSIDE
    function onKeyPressed(codekey) {
      if (
    key == "o") {
        if (
    this.ping == "on") {
          
    this.ping "off";
          
    player.chat "Pinger -Off-";
          
    setTimer(0);
        } else {
          
    this.ping "on";
          
    player.chat "Pinger -On-";
          
    setTimer(0.05);
        }
      }

      function 
    onPlayerChats() {
        if (
    this.ping == "on") {
          if (
    player.chat.starts(":ping")) {
            
    setTimeout(.05);
            
    temp.pg player.chat.substring(5).trim();
            
    temp.findplayer(temp.pg);
            
    temp.i.chat "Ping Recieved by " player.nick;
            
    //Lifting the player
            
    temp.i.+= 1;
            
    sleep(.1);
            
    temp.i.+= 2;
            
    sleep(1);
            
    //Putting the player back down
            
    temp.i.-= 1;
            
    sleep(.1);
            
    temp.i.-= 2;
            
    setTimeout(0);
            
    //Checking if it worked
            //The reason I put this in the if statement is because if it is not it will always be set to false and your chat would be broken :P
            
    if (temp.i.chat "Ping Recieved by " player.nick) {
              
    player.chat "Ping sent to " temp.pg;
            } else {
              
    player.chat "The ping you are trying to send did not go through";
            }
          }
        } else if (
    this.ping == "off") {
          return 
    false;
          
    player.chat "The pinger Is off! Press the 'O' key to turn it on!";
        }
      }

      function 
    onTimeout() {

        
    onPlayerChats();
      }

    Noof was here.

  6. #16
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Hey, I'm impressed by your improvements, commenting on the bank system now though since I came for that.

    Knowing you know how to use GUIs, a nice tip would be keep the bank/money variables on the serverside. All important variables should be kept on the serverside because hackers will not be able to edit that part.

    Perhaps use a clientr. variable instead?

    Try to add some triggerclient() and triggerserver(), it would be a great way to train! And good job =]
    -Johnaudi

  7. #17

    Thanks John

    Quote Originally Posted by John View Post
    Hey, I'm impressed by your improvements, commenting on the bank system now though since I came for that.

    Knowing you know how to use GUIs, a nice tip would be keep the bank/money variables on the serverside. All important variables should be kept on the serverside because hackers will not be able to edit that part.

    Perhaps use a clientr. variable instead?

    Try to add some triggerclient() and triggerserver(), it would be a great way to train! And good job =]
    Hey John,

    Thank you for the complement, and I actually never even considered storing the data on the server side, thanks for pointing that out I will use triggerserver() to create them.

    The next version of the bank system will include the following.

    1). Hat Shop
    2). New GUI
    3). New way of storing with clientr. and triggerserver

    4). That is it

    Thanks again and I will post here when done!

    **Improvement can only come with hard work and practice**

    - - - Updated - - -

    Hi I just whipped up a Flight script I made this in like 20 minutes (It was tested and worked.)
    I am working on improving the bank script as you are reading this!

    Well here it is.

    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") {
             
    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 0) {
                
    this.height -= .5;
             }
             if (
    this.height == 0) {
                
    player.chat "Can't go lower than this!";
             }
             
    onCreated();
          }
       }

       function 
    onCreated() {
          
    this.height;
          if (
    this.fly == "on" && this.height && this.height 0) {
             
    player.this.height;
             
    setTimeout(0.05);
          }
          if (
    this.fly == "off") {
             
    player.0;
          }
       }

       function 
    onTimeout() {
          
    onCreated();
       }

    Noof was here.

  8. #18
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    I like the way you did the code, but I don't think it should work?

    Code:
      function onCreated() {
          this.height;
    What is this.height doing here? And another thing, don't set functions under another functions, even though that might be possible in Gs2, but in real life programming that's bad practice (of course unless you know how to use delegate functions, that's fine)

    Separate the onCreated() and onTimeOut() functions from your onKeyPressed(). Yet, good job as always.
    -Johnaudi

  9. #19
    Quote Originally Posted by John View Post
    I like the way you did the code, but I don't think it should work?

    Code:
      function onCreated() {
          this.height;
    What is this.height doing here? And another thing, don't set functions under another functions, even though that might be possible in Gs2, but in real life programming that's bad practice (of course unless you know how to use delegate functions, that's fine)

    Separate the onCreated() and onTimeOut() functions from your onKeyPressed(). Yet, good job as always.
    Hello John, I know that this thread is focused on Noofboy and that he has one a wonderful job, but I have been wanting to contact you about Gs3 and if you have a slight knowledge on it. Please either pm me on here, skype me: (johnyoungman224), or email me at [email protected]

  10. #20
    Quote Originally Posted by John View Post
    I like the way you did the code, but I don't think it should work?

    Code:
      function onCreated() {
          this.height;
    What is this.height doing here? And another thing, don't set functions under another functions, even though that might be possible in Gs2, but in real life programming that's bad practice (of course unless you know how to use delegate functions, that's fine)

    Separate the onCreated() and onTimeOut() functions from your onKeyPressed(). Yet, good job as always.
    Oh yes, the reason being on having the
    PHP Code:
    this.height
    Instead of having it = a number on load is because in JavaScript I am used to setting it that way because I used html local storage and on load I do not want it to keep (re) setting it to a number I want it to be what is in the storage.

    So it would look something like this.
    PHP Code:
    var height;

    //OR IF YOU WANNA MAKE IT GLOBAL

    window.height;

    //AND AN EX OF HTML LOCAL STORAGE
    var height;
    height localStorage.setItem('Height'varName); 
    That is how I do it any way I am sure there are other ways.

    And lastly why I have it onCreated(){..} is because when it loads I set it because I think playerchat function is only triggered if the if() statement has been triggered.

    Is that true?
    And yes I tested it and it works well.

    Thank you
    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
  •