client
PlayerPedId
FiveM client native documentation with a Lua example.
Summary
Returns the ped handle for the local player. The fastest, simplest way to reference the current player's character on the client.
Returns
Ped (number) — the local player's ped handle.
Example
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local health = GetEntityHealth(ped)Common pitfalls
- The handle changes on respawn or model change — call PlayerPedId() fresh rather than storing it long-term.
- Cache it within a single frame's work, but refresh each tick if the ped can change.
Related natives
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 →