Skip to main content

Exports

This guide explains how to use the exports provided by the Coinsystem V2 script.

Exports: Client​

open()​

exports.sky_coinsystem:open()

This export opens the Coinsystem V2 interface.

Example
RegisterCommand("coinsystem", function()
exports.sky_coinsystem:open()
end, false)

Exports: Server​

giveCoins(receiver_id: number, amount: number)​

exports.sky_coinsystem:giveCoins(receiver_id: number, amount: number)

This export gives coins to a player.

Example
RegisterNetEvent("coinsReward", function(amount)
local player = source
exports.sky_coinsystem:giveCoins(player, amount)
end)

removeCoins(player_id: number, amount: number)​

exports.sky_coinsystem:removeCoins(target_id: number, amount: number)

This export removes coins from a player.

Example
RegisterNetEvent("coinsRemove", function(amount)
local player = source
exports.sky_coinsystem:removeCoins(player, amount)
end)

getCoins()​

exports.sky_coinsystem:getCoins()

This export gets the coins of a player.

Example
-- Server:
RegisterNetEvent("server:coinsGet", function()
local player = source
local coins = exports.sky_coinsystem:getCoins(player)
TriggerClientEvent("client:coinsGet", player, coins)
end)
-- Client:
RegisterNetEvent("client:coinsGet", function(coins)
print("Coins: " .. coins)
end)