Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Currency Script
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


This script allows you to have more than one type of currency(Ex. Gold, Gil, Cash) Just add these commands somewhere in Game_Party

Demos at bottom

to add to Gil use this line
Code:
$game_party.gaingil(put the amount here)

and for cash

Code:
$game_party.gaincash(put the amount here)

Code:
#--------------------------------------------------------------------------
  # EDIT START
  #--------------------------------------------------------------------------
  def gain_gil(n)
    @gil = [[@gil + n, 0].max, 9999999].min
  end
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  def lose_gil(n)
    # Reverse the numerical value and call it gain_gil
    gain_gil(-n)
  end
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
    def gain_cash(n)
    @cash = [[@cash + n, 0].max, 9999999].min
  end
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  def lose_cash(n)
    # Reverse the numerical value and call it gain_gold
    gain_cash(-n)
  end
  
  #5 gil = 1 gold
  #1 cash = 3 gold
  #15 gil = 1 cash

  def giltogold(gil_amount = @gil)
    return if @gil < 5
    @gil /= 5
    @gold += @gil
    @gil -= @gil
  end
  
  def giltocash(gil_amount = @gil)
    return if @gil < 15
    @gil /= 15
    @cash += @gil
    @gil -= @gil
  end
  
  def goldtogil(gold_amount = @gold)
    @gil += gold_amount * 5
    @gold -= gold_amount
  end
  
  def cashtogil(cash_amount = @cash)
    @gil += cash_amount * 5
    @cash -= cash_amount
  end
  
  def goldtocash(gold_amount = @gold)
    return if @gold < 3
    @gold /= 3
    @cash += @gold
    @gold -= @gold
  end
  
  def cashtogold(cash_amount = @cash)
    @gold += cash_amount * 3
    @cash -= cash_amount
  end
  #--------------------------------------------------------------------------
  # EDIT STOP
  #--------------------------------------------------------------------------

For got the thanks:

SephirothSpawn - For helping me with the currency exchange
ShadowWolf- For giving me the idea



.rar   NewMoney.rar (Size: 190.74 KB / Downloads: 3)
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change character script jaigai 0 2,798 11-19-2006, 01:00 PM
Last Post: jaigai
  Just a modification of Abyssos' facs script lumina... 0 2,635 11-01-2006, 01:00 PM
Last Post: lumina...
  Credit Script 1.1 acoole 0 2,476 10-24-2006, 01:00 PM
Last Post: acoole
  Script Dev Kit Nick 0 2,845 10-15-2006, 01:00 PM
Last Post: Nick
  Opening Image script sasuke89 0 2,061 07-24-2006, 01:00 PM
Last Post: sasuke89
  Change Color of The diferent Status Script MASTERLOKI 0 2,313 07-18-2006, 01:00 PM
Last Post: MASTERLOKI
  Event Name and ID Search Script Hadriel 0 2,077 06-21-2006, 01:00 PM
Last Post: Hadriel
  Book Script and Utility Bruth 0 2,263 05-07-2006, 01:00 PM
Last Post: Bruth
  Individuality Script DrakoShade 0 2,223 03-12-2006, 01:00 PM
Last Post: DrakoShade
  Metroid Text Sound Script Constance 0 2,207 12-21-2005, 01:00 PM
Last Post: Constance



Users browsing this thread: