Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Hat Shop and Inventory + Video Script -Noof*

  1. #1

    Hat Shop and Inventory + Video Script -Noof*

    Hello everybody,

    It's me Noof, and I took about a week break or so from posting sorry about that, was working on my game :=) .

    I have a neat little script I put together, since I am not currently employed on a graal server, my effort was not 100% put into the design and there is one bug I know of but I can fix it another day,

    How to use it!
    (1). Type in "/shop" , (Pretty unique, huh? haha).
    (2). Navigate to the "Hat Shop" button.
    (3). Buy the hats you would like.
    (4). Go to the inventory to select the hat you would like to wear.

    Why did I kind of stop working on this?

    Well from the start the naming conventions that I've used are complete, B L O O P , and I found it hard to go back and add more buttons because it was getting out of control, anyway here is the code below, if used please credit me other than that it is free to use. Since this is mostly GUI based their is not much real powerful type of code other than the changing player attributes and some if statements and vars .

    C O D E
    PHP Code:
    /*
    Planning algrithm.
    on Player Chats,
    if shop,
    bring up question GUI ("what Kind of shop"),
    get answer and react,
    if hat was clicked,  run hat shop func 
    if other was clicked, other func will run along with the GUI,
    along with all kinds of functions and GUI's to apear with it,
    might use GUI/might Not.
    ---NOOOOOOF*
    */

    //#CLIENTSIDE
    function onCreated() {
      
    Equi1.hide();
      
    Equi2.hide();
      
    Equi3.hide();
      
    //onRun(); // testing purposes DELETE
    }

    function 
    Shop_Button.onMouseDown() {
      
    Main_Shop.hide();
      new 
    GuiWindowCtrl("Hat_Shop") {
        
    profile GuiBlueWindowProfile;
        
    400;
        
    80;
        
    width 500;
        
    height 400;
        
    text "Shop V.1.0";
        
    opacity "no";
        new 
    GuiTextCtrl("Test_Text1") {
          
    profile GuiBlueTextProfile;
          
    110;
          
    25;
          
    height 50;
          
    this.coins 30000;
          
    text "Coins:" SPC this.coins;
        }
        new 
    GuiButtonCtrl("Inv_Btn") {
          
    profile GuiBlueButtonProfile;
          
    10;
          
    25;
          
    width 100;
          
    height 30;
          
    text "Hat Inventory!";
        }
        new 
    GuiBitmapButtonCtrl("Hat_1") {
          
    10;
          
    60;
          
    width 192;
          
    height 144;
          
    normalbitmap "Haat.png";
          
    mouseoverbitmap "onedollar.png";
          
    pressedbitmap "dollarcheck.png";
        }
        new 
    GuiBitmapButtonCtrl("Hat_2") {
          
    230;
          
    60;
          
    width 192;
          
    height 144;
          
    normalbitmap "ski-hat.png";
          
    mouseoverbitmap "onedollar.png";
          
    pressedbitmap "dollarcheck.png";
        }
        new 
    GuiBitmapButtonCtrl("Hat_3") {
          
    10;
          
    230;
          
    width 192;
          
    height 144;
          
    normalbitmap "hat1.png";
          
    mouseoverbitmap "onedollar.png";
          
    pressedbitmap "dollarcheck.png";
        }
      }
    }

    function 
    onPlayerChats() {
      if (
    player.chat == "/shop") {
        
    Equi1.hide();
        
    Equi2.hide();
        
    Equi3.hide();
        
    onRun();
      }
    }

    function 
    onRun() {
      
    player.chat "";
      
    //NEW GUI Stuff GOES HERE
      
    new GuiWindowCtrl("Main_Shop") {
        
    profile GuiBlueWindowProfile;
        
    400;
        
    80;
        
    width 500;
        
    height 100;
        
    text "Shop V.1.0";
        
    opacity "no";
        new 
    GuiButtonCtrl("Shop_Button") {
          
    profile GuiBlueButtonProfile;
          
    20;
          
    50;
          
    width 100;
          
    height 30;
          
    text "Hat Shop";
        }
      }
    }
    this.bought1 false;

    function 
    Hat_1.onMouseDown() {
      
    this.bought1 true;
      
    this.coins 30000;
      
    this.coins this.coins 1000;
      
    Test_Text1.text this.coins;
      
    say2("You bought Hat 1!");

    }
    this.bought2 false;

    function 
    Hat_2.onMouseDown() {
      
    this.bought2 true;
      
    this.coins 30000;
      
    this.coins this.coins 1000;
      
    Test_Text1.text this.coins;
      
    say2("You bought Hat 1!");

    }
    this.bought3 false;

    function 
    Hat_3.onMouseDown() {
      
    this.bought3 true;
      
    this.coins 30000;
      
    this.coins this.coins 1000;
      
    Test_Text1.text this.coins;
      
    say2("You bought Hat 3!");

    }

    function 
    Inv_Btn.onMouseDown() {
      
    Equi1.hide();
      
    Equi2.hide();
      
    Equi3.hide();
      
    Hat_Shop.hide();
      
    Hat_Inv.show();
      new 
    GuiWindowCtrl("Hat_Inv") {
        
    Equi1.hide();
        
    Equi2.hide();
        
    Equi3.hide();
        
    profile GuiBlueWindowProfile;
        
    400;
        
    80;
        
    Equi1.hide();
        
    Equi2.hide();
        
    Equi3.hide();
        
    width 500;
        
    height 400;
        
    text "Inventory";
        
    opacity "no";
        new 
    GuiButtonCtrl("Shop_Button21") {
          
    profile GuiBlueButtonProfile;
          
    200;
          
    30;
          
    width 100;
          
    height 30;
          
    text "Shop";
        }
        
    Equi1.hide();
        new 
    GuiButtonCtrl("Equi1") {
          
    profile GuiBlueButtonProfile;
          
    10;
          
    25;
          
    600;
          
    width 100;
          
    height 30;
          
    text "Hat 1!";
        }
        
    Equi3.hide();
        new 
    GuiButtonCtrl("Equi3") {
          
    profile GuiBlueButtonProfile;
          
    10;
          
    90;
          
    600;
          
    width 100;
          
    height 30;
          
    text "Hat 3!";
        }
        
    Equi2.hide();
        new 
    GuiButtonCtrl("Equi2") {
          
    profile GuiBlueButtonProfile;
          
    10;
          
    50;
          
    600;
          
    width 100;
          
    height 30;
          
    text "Hat 2!";
        }
      }
      if (
    this.bought1 == true) {
        
    Equi1.show();

      }
      if (
    this.bought2 == true) {
        
    Equi2.show();

      }
      if (
    this.bought3 == true) {
        
    Equi3.show();

      }

      function 
    Shop_Button21.onMouseDown() {
        
    Hat_Inv.hide();
        
    Hat_Shop.show();
        
    Equi1.hide();
        
    Equi2.hide();
        
    Equi3.hide();
      }

      function 
    Equi1.onMouseDown() {
        
    player.attr[1] = "haat.png";
      }

      function 
    Equi2.onMouseDown() {
        
    player.attr[1] = "ski-hat.png";
      }

      function 
    Equi3.onMouseDown() {
        
    player.attr[1] = "hat1.png";
      }

    V I D E O


    I M A G E S Y O U W I L L N E E D :
    PdyeyzQ.png wOvW05P.png 7S9tAfM.png 3rU2XN1.png 0HvbcWC.png
    Noof was here.

  2. #2
    oh look a guy is using my stuff,yay
    Just being me.

  3. #3
    Raven Ventus Victor's Avatar
    Join Date
    Feb 2014
    Location
    Malaysia
    Posts
    2,977
    That looks interesting, what game is that?

  4. #4
    Quote Originally Posted by Bram View Post
    oh look a guy is using my stuff,yay

    Woooops, I am sorry about that, I should of asked your permission first. I will take it down if necessary

    Quote Originally Posted by Victor View Post
    That looks interesting, what game is that?

    It's Minecraft, No not really it is the PC version of graal (you can play other players servers).
    Find out more here,
    link
    Noof was here.

  5. #5
    Quote Originally Posted by Bram View Post
    oh look a guy is using my stuff,yay
    Or you could be grateful someone found your work good enough to be used instead of being such a pessimist about everything. Try growing up.

  6. #6
    Quote Originally Posted by Distorted View Post
    Or you could be grateful someone found your work good enough to be used instead of being such a pessimist about everything. Try growing up.
    Was no sarcasm, I dont care If he use That stuff
    Just being me.

  7. #7
    Banned
    Join Date
    Jun 2013
    Location
    Singapore
    Posts
    10,403
    Come on guys, let the owner have fun.

  8. #8
    Quote Originally Posted by bram View Post
    was no sarcasm, i dont care if he use that stuff
    oh lmfaooooo

  9. #9
    Quote Originally Posted by XSTARX View Post
    Come on guys, let the owner have fun.
    Hmm? ,
    And for everyone fighting ect, please stop.

    It would be appreciated, thanks!

    -Noof*
    Noof was here.

  10. #10
    Crow Greeze's Avatar
    Join Date
    Jul 2013
    Location
    Countryside
    Posts
    2,374
    looks good

    Click here for my Levels Thread

    Join the fun on Era-go.com today

Tags for this Thread

Posting Permissions

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