Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24

Thread: Bank system script

  1. #1

    Noof's scripts

    Hi I recently made a script that shows your cash with a showText() and a GUI with commands and buttons to subtract and add your dollars to your wallet and bank. Check it out below.

    PHP Code:
    /*This is a bank and cash system made with GS2

    This was created on the TestBed server and made by Noof.
    Graal Id : Graal1138884
     
     How to use it?
    You log on and you start with 0 cash and 0 in the bank, if you 
    click add cash you will be given 1 dollar and you can deposit that in your bank 
    as well withdraw.

    Thank you
    Note: This is on clientside so only you will be able to see "your own" cash and bank GUI.
    */

    //#CLIENTSIDE
    //Here is the logic and addition/subtraction happens
    function Test_Button.onAction() {
      
    with(findimg(200)) {
        
    this.money += 1;
        
    text "Cash: " this.money;
        
    Test_Text.text "Cash: " this.money;
      }
    }

    function 
    Test_Button2.onAction() {
      
    with(findimg(200)) {
        if (
    this.money 0) {
          
    this.money -= 1;
          
    text "Cash: " this.money;
          
    Test_Text.text "Cash: " this.money;
          
    this.bank += 1;
          
    Test_Text2.text "Bank: " this.bank;
        }
      }
      if (
    this.money 0) {
        return 
    false;
      } else {
        return 
    true;
      }
    }

    function 
    Test_Button3.onAction() {
      
    with(findimg(200)) {
        
    this.money this.money this.bank;
        
    text "Cash: " this.money;
        
    Test_Text.text "Cash: " this.money;
        
    this.bank -= this.bank;
        
    Test_Text2.text "Bank: " this.bank;
      }
    }

    function 
    onCreated() {
      
    with(findimg(200)) {
        
    this.money += 1;
        
    text "Cash: " this.money;
        
    Test_Text.text "Cash: " this.money;
      }
      
    Test_Window.destroy();
      new 
    GuiWindowCtrl("Test_Window") {
        
    profile GuiBlueWindowProfile;
        
    canmove false;
        
    canresize false;
        
    closequery false;
        
    transparent false;
        
    10;
        
    10;
        
    width 300;
        
    height 200;
        
    text "Bank.";
        new 
    GuiButtonCtrl("Test_Button") {
          
    profile GuiBlueButtonProfile;
          
    10;
          
    50;
          
    width 100;
          
    height 30;
          
    text "Add Dollars";
        }
        new 
    GuiButtonCtrl("Test_Button2") {
          
    profile GuiBlueButtonProfile;
          
    10;
          
    90;
          
    width 100;
          
    height 30;
          
    text "Put cash in bank";
        }
        new 
    GuiButtonCtrl("Test_Button3") {
          
    profile GuiBlueButtonProfile;
          
    10;
          
    140;
          
    width 250;
          
    height 30;
          
    text "Take cash out of bank";
        }
        new 
    GuiTextCtrl("Test_Text") {
          
    profile GuiBlueTextProfile;
          
    120;
          
    50;
          
    height 15;
          
    text "Cash: " this.money;
        }
        new 
    GuiTextCtrl("Test_Text2") {
          
    profile GuiBlueTextProfile;
          
    120;
          
    90;
          
    height 20;
          
    text "Bank: " this.bank;
        }
      }
      
    onSolve();
    }

    function 
    onSolve() {
      
    temp.sx .95 screenwidth;
      
    temp.sy .95 screenheight;
      
    //start doing stuff
      
    this.bank 1;
      
    this.money//declaring the players intital money!
      
    showtext(200temp.sxtemp.sy"Arial""(b,i,r,c)""Cash: " this.money 1);
      
    changeimgvis(2004); // it has to be over 4 for it to stick on the screen
      
    setTimeout(0.5);

    Thanks for your time!

    -Noof
    Last edited by Noofboy12; 01-07-2015 at 09:19 PM.
    Noof was here.

  2. #2
    Veteran Tempest T's Avatar
    Join Date
    Jan 2015
    Location
    Albany, CA
    Posts
    203
    I thought the bank idea was looked down upon. Although most people don't like the bank idea, I do believe this could be implemented into the game, especially since you scripted it for us Apply for Era's scripting team! I'm sure they could use your skill. This probably wont be put in the game anytime soon but it could be, good job!

    - - - Updated - - -

    Also putting EC in the bank is a great idea, the reason everyone didn't like the idea was because they thought it was pointless.

    - - - Updated - - -

    was because you can store money already on yourself why put it somewhere else.


    Work like there is someone working twenty-four hours a day
    to take it all away from you.-Mark Cuban




  3. #3
    Dont know what any of the script means.... But good job XD
    Welcome to the forums!

  4. #4
    hextraordinary Hex's Avatar
    Join Date
    Jun 2013
    Location
    Straya
    Posts
    2,906
    Looks neat, can i see a visual of this from the testbed server?

  5. #5
    Quote Originally Posted by Myst View Post
    Looks neat, can i see a visual of this from the testbed server?
    Yeah sure come on and ill add it to you!
    Noof was here.

  6. #6
    Street Boss NJK's Avatar
    Join Date
    Mar 2014
    Location
    Mexico
    Posts
    707
    Good Job!
    Need Help?
    Shoot me a PM on Era-Go! I will gladly help you!

    Contact Me?
    Skype: santiago ornelas
    Email: [email protected]

  7. #7
    Big Cheese Amazing Ace's Avatar
    Join Date
    Oct 2014
    Location
    Under the Ace of Spades
    Posts
    1,913
    Well done, hopefully this is successful and can be implemented.

  8. #8
    hwaryun
    Guest
    Would be cool if it had an interest system.

  9. #9
    Hi I just finished making my crippled staff boots for IphoneEra these won't be used in it but they always could be for a quick counter hop and getting on a roof(For staff of course)
    Note: Do NOT attempt to try this to 'hack' you will be wasting your time :P
    Note: What makes them crippled you have to keep clicking to move your character.
    here it is.
    PHP Code:
    /*click the arrow keys to move around note it is crippled and only used for small purposes(such as hosting events or so/ could be used as an alternative key pad for developers/staff members and this shall not be used for developing purposes as it will slow down your production majorly and slow down your walking. 
    Made by Noof.
    Last edited on 1-7-15
    Made on the TestBed server
    Enjoy
    */



    //#CLIENTSIDE
    function onCreated() {
      
    setTimeout(.05);
      new 
    GuiControl("Test_Back") {
        
    useownprofile true;
        
    profile.border 0;
        
    50;
        
    600;
        
    width 200;
        
    height 110;
        new 
    GuiButtonCtrl("Up") {
          
    profile GuiBlueButtonProfile;
          
    60;
          
    5;
          
    width 60;
          
    height 30;
          
    text "UP";
        }
        new 
    GuiButtonCtrl("Down") {
          
    profile GuiBlueButtonProfile;
          
    60;
          
    60;
          
    width 60;
          
    height 30;
          
    text "Down";
        }
        new 
    GuiButtonCtrl("Right") {
          
    profile GuiBlueButtonProfile;
          
    120;
          
    30;
          
    width 60;
          
    height 30;
          
    text "Right";
        }
        new 
    GuiButtonCtrl("Left") {
          
    profile GuiBlueButtonProfile;
          
    0;
          
    30;
          
    width 60;
          
    height 30;
          
    text "Left";
        }
      }
    }

    function 
    onTimeout() {
      function 
    Up.onMouseDown() {
        
    player.dir 4;
        
    player.player.3;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }

      function 
    Down.onMouseDown() {
        
    player.dir 2;
        
    player.player.2;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }
      
    //Left is what the left button is called

      
    function Left.onMouseDown() {
        
    player.dir 1;
        
    player.player.2;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }

      function 
    Right.onMouseDown() {
        
    player.dir 3;
        
    player.player.2;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }

    Noof was here.

  10. #10
    hextraordinary Hex's Avatar
    Join Date
    Jun 2013
    Location
    Straya
    Posts
    2,906
    Quote Originally Posted by Noofboy12 View Post
    Hi I just finished making my crippled staff boots for IphoneEra these won't be used in it but they always could be for a quick counter hop and getting on a roof(For staff of course)
    Note: Do NOT attempt to try this to 'hack' you will be wasting your time :P
    Note: What makes them crippled you have to keep clicking to move your character.
    here it is.
    PHP Code:
    /*click the arrow keys to move around note it is crippled and only used for small purposes(such as hosting events or so/ could be used as an alternative key pad for developers/staff members and this shall not be used for developing purposes as it will slow down your production majorly and slow down your walking. 
    Made by Noof.
    Last edited on 1-7-15
    Made on the TestBed server
    Enjoy
    */



    //#CLIENTSIDE
    function onCreated() {
      
    setTimeout(.05);
      new 
    GuiControl("Test_Back") {
        
    useownprofile true;
        
    profile.border 0;
        
    50;
        
    600;
        
    width 200;
        
    height 110;
        new 
    GuiButtonCtrl("Up") {
          
    profile GuiBlueButtonProfile;
          
    60;
          
    5;
          
    width 60;
          
    height 30;
          
    text "UP";
        }
        new 
    GuiButtonCtrl("Down") {
          
    profile GuiBlueButtonProfile;
          
    60;
          
    60;
          
    width 60;
          
    height 30;
          
    text "Down";
        }
        new 
    GuiButtonCtrl("Right") {
          
    profile GuiBlueButtonProfile;
          
    120;
          
    30;
          
    width 60;
          
    height 30;
          
    text "Right";
        }
        new 
    GuiButtonCtrl("Left") {
          
    profile GuiBlueButtonProfile;
          
    0;
          
    30;
          
    width 60;
          
    height 30;
          
    text "Left";
        }
      }
    }

    function 
    onTimeout() {
      function 
    Up.onMouseDown() {
        
    player.dir 4;
        
    player.player.3;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }

      function 
    Down.onMouseDown() {
        
    player.dir 2;
        
    player.player.2;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }
      
    //Left is what the left button is called

      
    function Left.onMouseDown() {
        
    player.dir 1;
        
    player.player.2;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }

      function 
    Right.onMouseDown() {
        
    player.dir 3;
        
    player.player.2;
        for (
    playersprite 1playersprite 4playersprite++) {
          
    // how fast the animation plays (0.05 is good)
          
    sleep 0.05;
        }
      }

    im on the testbed

Posting Permissions

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