Shop Example Script

Learn more on how to use Sandbox, or submit your own tutorials or resources.
User avatar
Eagle
Member
Member
Posts: 148
Joined: December 15th, 2009, 11:40 pm
Name: Vickie Eagle
Contact:

Re: Shop Example Script

Postby Eagle » January 5th, 2010, 11:27 am

This is outstanding! thank you so much!

Always~
Vickie ;)
I put time in a bottle ... just saying :))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

User avatar
PizzaLover101
Member
Member
Posts: 1751
Joined: October 23rd, 2009, 1:33 pm
Name: NAME
IRC Username: DaItsicle
Location: By a computer
Contact:

Re: Shop Example Script

Postby PizzaLover101 » January 21st, 2010, 6:18 pm

is there any way you can put this into 2.6, ya know, just click a button, and Poof, it's there?
Project 1: Da Chest Collector [TBD]
Project 2: Tis a secret [End of summer] announcement June 22 2011
Project 3: An even bigger secret!

http://pizzagametime.tk/
http://forums.pizzagametime.tk/

User avatar
GR1M
Support Team
Support Team
Posts: 1305
Joined: August 22nd, 2009, 4:35 pm
Name: Luke
IRC Username: Gr1m
Location: Texas
Contact:

Re: Shop Example Script

Postby GR1M » January 21st, 2010, 7:38 pm

Some one has to make the script to do that.
Image
Want a user bar like this one? PM Leo

User avatar
klimyriad
Support Team
Support Team
Posts: 969
Joined: December 23rd, 2009, 1:43 pm
Name: liam
Contact:

Re: Shop Example Script

Postby klimyriad » March 25th, 2010, 4:14 pm

HI i trying to put the scripted to sandbox how do i do it
Firstspace the attack Progress. Image
Maps= Image finishing the town of hisal map.
Models and textures Image Just started finding these.
Menus, script's and other stuff. Image

User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Shop Example Script

Postby Leo_V117 » March 27th, 2010, 9:59 am

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.

the game masters G.D
Member
Member
Posts: 13
Joined: April 11th, 2010, 8:01 pm
Name: spencer

Re: Shop Example Script

Postby the game masters G.D » April 14th, 2010, 3:20 pm

can you use the sword

User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Shop Example Script

Postby Leo_V117 » April 14th, 2010, 3:35 pm

Nope. Weapon implementation is currently unnavailable.

Harrison
Member
Member
Posts: 1
Joined: June 30th, 2010, 12:34 am
Name: Harrison

Re: Shop Example Script

Postby Harrison » June 30th, 2010, 12:41 am

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:

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Shop Example Script

Postby arcones » June 30th, 2010, 1:33 pm

:lol: Well, most of us knew what was needed but thanks anyways ;)
Image
Want a user bar like this one? PM Leo!

User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Shop Example Script

Postby Leo_V117 » June 30th, 2010, 2:29 pm

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


Return to “Tutorials and Resources”

Who is online

Users browsing this forum: No registered users and 1 guest