currency balance||doc135596

September 20, 2022

Format

 Player:getWalletBalance(coinName) 
  • The class to which the function belongs:Player

Description

Returns the currency balance.


Parameters

Variable name type Description
coinName string currency name


Value Returned

type Description
int balance


Code Samples

On the server side of the player entity templatemount script, when a registered player logs inCallback, get the currency balance

Trigger.addHandler(this:cfg(), "ENTITY_ENTER", function(context)
    local player = context.obj1
    local balance = player:getWalletBalance("green_currency")
    print(balance)
end)