📦 Scripts
🎁 Akilla Donator
Commands & Exports
Server Exports

📥 Server Exports

Exports available for server-side scripts.

GetPlayerCoins

Get a player's coin balance.

local coins = exports['akilla-donator']:GetPlayerCoins(source)
print('Player has ' .. coins .. ' coins')

AddPlayerCoins

Add coins to a player's balance.

local success = exports['akilla-donator']:AddPlayerCoins(source, 100, 'Daily reward')
if success then
    print('Added 100 coins')
end

Parameters:

  • source - Player server ID
  • amount - Coins to add
  • reason - Reason for transaction (optional)

RemovePlayerCoins

Remove coins from a player's balance.

local success = exports['akilla-donator']:RemovePlayerCoins(source, 50, 'VIP purchase')
if success then
    print('Removed 50 coins')
end

SetPlayerCoins

Set a player's coin balance.

exports['akilla-donator']:SetPlayerCoins(source, 500, 'Balance reset')

Example Integrations

Daily Reward System

-- Give daily coins
RegisterCommand('daily', function(source)
    local lastClaim = GetLastDailyClaim(source)
    if CanClaimDaily(lastClaim) then
        exports['akilla-donator']:AddPlayerCoins(source, 10, 'Daily reward')
        TriggerClientEvent('ox_lib:notify', source, {
            title = 'Daily Reward',
            description = 'You received 10 coins!',
            type = 'success'
        })
    end
end)

VIP Purchase

-- Spend coins for VIP
RegisterCommand('buyvip', function(source)
    local coins = exports['akilla-donator']:GetPlayerCoins(source)
    if coins >= 500 then
        exports['akilla-donator']:RemovePlayerCoins(source, 500, 'VIP purchase')
        -- Grant VIP status
        GivePlayerVIP(source)
    end
end)

Coin Transfer

-- Transfer coins between players
RegisterCommand('sendcoins', function(source, args)
    local target = tonumber(args[1])
    local amount = tonumber(args[2])
    
    local coins = exports['akilla-donator']:GetPlayerCoins(source)
    if coins >= amount then
        exports['akilla-donator']:RemovePlayerCoins(source, amount, 'Transfer to ' .. target)
        exports['akilla-donator']:AddPlayerCoins(target, amount, 'Transfer from ' .. source)
    end
end)