Page 3 of 6

Re: Shop Example Script

Posted: January 5th, 2010, 11:27 am
by Eagle
This is outstanding! thank you so much!

Always~
Vickie ;)

Re: Shop Example Script

Posted: January 21st, 2010, 6:18 pm
by PizzaLover101
is there any way you can put this into 2.6, ya know, just click a button, and Poof, it's there?

Re: Shop Example Script

Posted: January 21st, 2010, 7:38 pm
by GR1M
Some one has to make the script to do that.

Re: Shop Example Script

Posted: March 25th, 2010, 4:14 pm
by klimyriad
HI i trying to put the scripted to sandbox how do i do it

Re: Shop Example Script

Posted: March 27th, 2010, 9:59 am
by Leo_V117
heh. Did someone say "Someone has to make a script for that"? A script for what? If its an app or module. im willing to code it in.

Re: Shop Example Script

Posted: April 14th, 2010, 3:20 pm
by the game masters G.D
can you use the sword

Re: Shop Example Script

Posted: April 14th, 2010, 3:35 pm
by Leo_V117
Nope. Weapon implementation is currently unnavailable.

Re: Shop Example Script

Posted: June 30th, 2010, 12:41 am
by Harrison
Hello guys I'm a little knew here. I was reading this thread and I noticed that he said he could not figure out how to make the shopkeeper say if he didn't have enough money. Well lucky for you guys I know a little programing :D . I'm positive this will work.

Code: Select all

    "on_start" = [
       money = 0
       pie = 0
       sword = 0
       treasure = 0
       ]

    "level_trigger_1" = [ money = ( + $money 5 )
       echo "You got 5 moneys."
       ]

    "level_trigger_2" = "showgui Shopkeeper"

    newgui Shopkeeper [
       guitext "What're ya buyin, stranger?" chat
       guibar
       guilist [
          guibutton "Pie: 10 moneys" [
             if ( > $money 9 ) [
                money = ( - $money 10 )
                pie = ( + $pie 1 )
             ]
            else if ( < $money 10 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
          ]
          guibar
          guibutton "Sword: 20 moneys" [
             if ( > $money 19 ) [
                money = ( - $money 20 )
                sword = ( + $sword 1 )
                ]
             else if ( < $money 20 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
             ]
          guibar
          guibutton "Treasure: 40 moneys" [
             if ( > $money 39 ) [
                money = ( - $money 40 )
                treasure = ( + $treasure 1 )
                ]
            else if ( < $money 40 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
             ]
       ]
    ]

    newgui Inventory [
    guibutton "Back" "cleargui 1"
    guibar
    guitext ( format "You have %1 moneys in your wallet." $money )
    guitext ( format "You have %1 pies.  Yum." $pie )
    guitext ( format "You have %1 swords.  Not that you can use them..." $sword )
    guitext ( format "You have %1 treasures.  Lucky you!" $treasure )
    ]

    newgui main [
       guilist [
          guilist [
             guibutton "Inventory" "showgui Inventory"
          ]
       ]
       guibar
       @main
    ]


Try that out. ;) all you had to do was add

Code: Select all

            else if ( < $money 10 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
after everything. How easy was that? :mrgreen:

Re: Shop Example Script

Posted: June 30th, 2010, 1:33 pm
by arcones
:lol: Well, most of us knew what was needed but thanks anyways ;)

Re: Shop Example Script

Posted: June 30th, 2010, 2:29 pm
by Leo_V117
Quick Note Harrison... Change it to this:

Code: Select all

                 else if ( < $money 10 ) [
                   echo "Sorry, you don't have enough money to buy this!"
                ]
That way it tells you instead of opening a new gui