- Documentation
- Server functions
- getAccountData
Function
getAccountData
Returns account data stored under a key. Account data is persistent: it stays after the player leaves and after a server restart.
Syntax
mixed getAccountData(account theAccount, string key)Arguments
theAccountaccount- The account.
keystring- The key.
Returns
The value or false.
Example
addEventHandler("onPlayerLogin", root, function(_, account)
setPlayerMoney(source, getAccountData(account, "money") or 0)
local skin = getAccountData(account, "skin")
if skin then setElementModel(source, skin) end
end)