• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Custom Points Mart Vendor

28
Posts
5
Years
  • Hey there, i am trying to code a special vendor that allows you to buy items from him that you gained with a special point system. The question is how would i do something like that. (I already made the variable show up and the system that allows for earning them.)

    If anyone could help me out that would be great.

    My idea was that it showed the normal Mart Selection Screen but instead of the PokeDollars, it would show the points as prices and your own money would show the points instead of the normal money one.
    That's a bit of a idea on how i want it.
     
    Last edited:
    277
    Posts
    15
    Years
  • Maybe something like this?

    Code:
    def pbSpecialMart
            Kernel.pbMessage(_INTL("Welcome to my shop."))
      loop do
        command=Kernel.pbShowCommandsWithHelp(nil,
           [_INTL("$100 A thing!"),
           _INTL("$150 Another thing!"),
           _INTL("$200 A better thing!"),
           _INTL("Exit")],
           [_INTL("A thing that does a thing."),
           _INTL("Another thing that also does a thing."),
           _INTL("A thing that does a thing but better."),
           _INTL("Are you finished shopping?")],-1
        )
        if command==0 # Buy a thing
          if  $globalVariableForSpecialMoney>=100
            $globalVariableForSpecialMoney-=100
            Kernel.pbReceiveItem(:THING)
          else
            Kernel.pbMessage(_INTL("I'm sorry but you don't have enough special money."))
          end
          end
        elsif command==1 # Buy Another thing
          if  $globalVariableForSpecialMoney>=150
            $globalVariableForSpecialMoney-=150
            Kernel.pbReceiveItem(:ANOTHERTHING)
          else
            Kernel.pbMessage(_INTL("I'm sorry but you don't have enough special money."))
          end
          end
        elsif command==2 # Buy A better thing
          if  $globalVariableForSpecialMoney>=200
            $globalVariableForSpecialMoney-=200
            Kernel.pbReceiveItem(:ABETTERTHING)
          else
            Kernel.pbMessage(_INTL("I'm sorry but you don't have enough special money."))
          end
          end
        else
            Kernel.pbMessage(_INTL("Please come again!"))
          break
        end
      end
    end
     
    Last edited:
    28
    Posts
    5
    Years
  • Maybe something like this?

    Code:
    def pbSpecialMart
            Kernel.pbMessage(_INTL("Welcome to my shop."))
      loop do
        command=Kernel.pbShowCommandsWithHelp(nil,
           [_INTL("$100 A thing!"),
           _INTL("$150 Another thing!"),
           _INTL("$200 A better thing!"),
           _INTL("Exit")],
           [_INTL("A thing that does a thing."),
           _INTL("Another thing that also does a thing."),
           _INTL("A thing that does a thing but better."),
           _INTL("Are you finished shopping?")],-1
        )
        if command==0 # Buy a thing
          if  $globalVariableForSpecialMoney>=100
            $globalVariableForSpecialMoney-=100
            Kernel.pbReceiveItem(:THING)
          else
            Kernel.pbMessage(_INTL("I'm sorry but you don't have enough special money."))
          end
          end
        elsif command==1 # Buy Another thing
          if  $globalVariableForSpecialMoney>=150
            $globalVariableForSpecialMoney-=150
            Kernel.pbReceiveItem(:ANOTHERTHING)
          else
            Kernel.pbMessage(_INTL("I'm sorry but you don't have enough special money."))
          end
          end
        elsif command==2 # Buy A better thing
          if  $globalVariableForSpecialMoney>=200
            $globalVariableForSpecialMoney-=200
            Kernel.pbReceiveItem(:ABETTERTHING)
          else
            Kernel.pbMessage(_INTL("I'm sorry but you don't have enough special money."))
          end
          end
        else
            Kernel.pbMessage(_INTL("Please come again!"))
          break
        end
      end
    end

    Thanks bud! imma gonna try it now!
     
    Back
    Top