Go to file
Giov4 68849d5690 + balance: min and max values + togglable negative ones when registering a currency
+ /currencies add/sub/set/balance/clearunregistered/clearbalance cmds
+ transfer/exchange/exists/clear_balance/remove_unregistered functions
+ changed database structure
2021-03-04 22:04:05 +01:00
LICENSE Add LICENSE 2021-03-04 16:27:56 +00:00
README.md Add README.md 2021-03-04 10:58:54 +00:00
api.lua + balance: min and max values + togglable negative ones when registering a currency 2021-03-04 22:04:05 +01:00
chatcmdbuilder.lua + balance: min and max values + togglable negative ones when registering a currency 2021-03-04 22:04:05 +01:00
commands.lua + balance: min and max values + togglable negative ones when registering a currency 2021-03-04 22:04:05 +01:00
init.lua + balance: min and max values + togglable negative ones when registering a currency 2021-03-04 22:04:05 +01:00
mod.conf Initial commit 2021-03-04 11:33:20 +01:00
utils.lua + balance: min and max values + togglable negative ones when registering a currency 2021-03-04 22:04:05 +01:00

README.md

API

currencies.register(currency)

Use this to register a currency, it is necessary in order to use every other function.


currencies.set(pl_name, currency, value)

Use this to set a player's balance.


currencies.add(pl_name, currency, value)

Use this to increase a player's balance.


currencies.sub(pl_name, currency, value)

Use this to decrease a player's balance.


currencies.get(pl_name, currency)

Use this to get a player's balance.



Example

currencies.register("skywars_money")

currencies.add("Giov4", "skywars_money", 300)
currencies.sub("Giov4", "skywars_money", 100)

local balance = currencies.get("Giov4", "skywars_money")
print(balance)  -- output: 200