GetPlayerPed
Docslocal retval = GetPlayerPed(playerId)Description
Gets the ped for a specified player index.
Parameters
| Name | Type | Description |
|---|---|---|
playerId | Player | The player index, or -1 to get the local player ped. |
Quick Snippet: Get Ped Handle→ Ped
→ PedUse this to get the player ped handle for this native.
-- Get the player's ped handle (client-side)
local ped = PlayerPedId()
print("Ped handle: " .. ped)
-- For a specific player's ped (server-side):
-- local targetPed = GetPlayerPed(source)Quick Snippet: Get PlayerplayerId
playerIdUse this to get the local player ID or a target player's server ID.
-- Get the local player index (client-side)
local playerId = PlayerId()
-- Get the local player's server ID (for server events)
local serverId = GetPlayerServerId(playerId)
print("Player ID: " .. playerId)
print("Server ID: " .. serverId)
-- Get player ped from a server ID:
-- local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId))Ped Models

mp_m_freemode_01
player_zero
ig_agatha
s_m_y_cop_01
s_m_m_gaffer_01
g_m_m_armboss_01
a_c_boar
a_m_m_bevhills_01Returns
PedReturns a ped (pedestrian) handle.
Examples
Official
local playerIdx = GetPlayerFromServerId(source)
local ped = GetPlayerPed(playerIdx)
-- act on the ped