68849d5690
+ /currencies add/sub/set/balance/clearunregistered/clearbalance cmds + transfer/exchange/exists/clear_balance/remove_unregistered functions + changed database structure |
||
---|---|---|
LICENSE | ||
README.md | ||
api.lua | ||
chatcmdbuilder.lua | ||
commands.lua | ||
init.lua | ||
mod.conf | ||
utils.lua |
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