📎💰Currency System
💰 Currency System: Server-Side Actions
infCore provides four core actions for interacting with a user's currency:
1️⃣ Get user currency
This will return -1 if the player is offline
local infCore = exports.infCore
RegisterCommand("getMoney", function()
local source = source
local user_id = infCore:getUserId(source) -- Get the User ID
-- Retrieve currency balances
local wallet = infCore:getUserMoney(user_id)
local bank = infCore:getUserBank(user_id)
local infCoins = infCore:getUserInfCoins(user_id)
end)
🛠️ Set Currency
setUserMoney(userId, amount)
– Set the wallet balancesetUserBank(userId, amount)
– Set the bank balancesetUserInfCoins(userId, amount)
– Set the infCoins balance
➕ Add Currency
addUserMoney(userId, amount)
– Adds to the walletaddUserBank(userId, amount)
– Adds to the bankaddUserInfCoins(userId, amount)
– Adds to the infCoins
➖ Remove Currency
removeUserMoney(userId, amount)
– Removes from walletremoveUserBank(userId, amount)
– Removes from bankremoveUserInfCoins(userId, amount)
– Removes from infCoins
Last updated