From the reference libraryFiveM

Client

esx/src/pages/en/esx_core/es_extended/client.mdx

Client

Global variables

All variables available on the client side inside the ESX Object.

Global variables > ESX.PlayerData

This is the player data object. See the Player Data page for more information.

Global variables > ESX.PlayerLoaded

Is the player and his character loaded?

Example

if ESX.PlayerLoaded then
    print('Player is loaded')
end

Global variables > ESX.playerId

The player's local id, a cached value of PlayerId().

Global variables > ESX.serverId

The player's server id, a cached value of GetPlayerServerId(PlayerId()).

Back to documentation