Jump to content
efeberk

Limited Item Count in Shop

Recommended Posts

#~ Features :
 
#~ This script allows to limit item count that player can buy.
 
Screenshot : 
 
ir5cgj.png
 
It means that player can't buy 16+ Magic Water in this shop.
 
Script : 
 


#~ -------------------------------------------------------------
#~ Script : Limited Items in Shop
#~ Scripter : efeberk
#~ Date : 26.04.2013
#~ Version : RMVX Ace
#~ -------------------------------------------------------------

#~ Features :

#~ This script allows to limit item count that player can buy.

#~ Example : LIMIT_VARIABLE = 33 

#~ This means : The limit count will be 33.variable value.

module EFEBERK
  LIMIT_VARIABLE = 33#Set this variable '0' to disable this option
end


class Window_ShopNumber < Window_Selectable

  def change_number(amount)
    if EFEBERK::LIMIT_VARIABLE > 0 && $game_variables[EFEBERK::LIMIT_VARIABLE] > 0
      @number = [[@number + amount, @max].min, 1].max if [[@number + amount, @max].min, 1].max <= $game_variables[EFEBERK::LIMIT_VARIABLE]
    else
      @number = [[@number + amount, @max].min, 1].max
    end
  end
end

 

 

Edited by efeberk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted