ESXclient
ESX.GetPlayerData
ESX client documentation with a FiveM Lua example.
Summary
Returns the local player's data on the client in ESX — job, accounts, inventory, and more.
Returns
table — the player data (job, accounts, inventory, etc.)
Example
ESX = exports['es_extended']:getSharedObject()
local data = ESX.GetPlayerData()
print(data.job.name)
print(data.job.grade_label)Common pitfalls
- On ESX 1.9+ always get the object via
exports['es_extended']:getSharedObject()— the old TriggerEvent pattern is deprecated and causes 'attempt to index a nil value (global ESX)'. - Client-side data isn't authoritative — 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 →