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
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →