QBCoreclient
QBCore.Functions.GetPlayerData
QBCore client documentation with a FiveM Lua example.
Summary
Returns the local player's data table on the client — job, money, metadata, charinfo, and more. The go-to way to read the current player's state client-side.
Returns
table — the player data (job, money, metadata, charinfo, etc.)
Example
local QBCore = exports['qb-core']:GetCoreObject()
local PlayerData = QBCore.Functions.GetPlayerData()
print(PlayerData.job.name) -- e.g. 'police'
print(PlayerData.job.grade.level)
print(PlayerData.money.cash)
print(PlayerData.charinfo.firstname)Common pitfalls
- On fresh load PlayerData may be empty until the player is fully loaded — listen for QBCore:Client:OnPlayerLoaded.
- This is client-side and reflects the local player only. For other players or authoritative checks, use the server-side Player object.
- Never trust client-side player data for anything security-sensitive — validate on the server.
Related functions
Related guides
Managing jobs on your server?
Viper Multi-Job lets players hold several jobs and switch between them with grade, salary and duty handled — QBCore, QBox and ESX, validated server-side.
See Viper Multi-Job →