-
Notifications
You must be signed in to change notification settings - Fork 77
nut.currency
Chessnut edited this page Jan 1, 2015
·
1 revision
This library provides a small system to handle how much is handled.
nut.currency.set(symbol, singular, plural)
- A shared function to define the symbol and name for the currency.
nut.currency.get(amount)
- Returns a nicely formatted name for amount money. For example, "$1 dollar" would be returned if amount was set to 1.
nut.currency.spawn(position, amount[, angle])
- Spawns a money entity at position with amount money. The optional angle can be provided to set the angle of the money entity created. This function returns the money entity.
character:hasMoney(amount)
- Returns a boolean of whether or not the character's money is greater than or equal to amount.
character:giveMoney(amount)
- Adds amount money to the character's current money.
character:takeMoney(amount)
- Removes amount money from the character's current money.