Skip to main content

PedDelete

Description

Deletes the given ped from the game.

danger

Passing an invalid value (such as nil, a table, etc...) will crash the game. Always ensure the ped exists and is valid before calling this function.

function PedDelete(ped) --[[ ... ]] end

Parameters

  • ped: integer - The ped to delete.

Return Values

None.

Example

Deletes Russell ped by pressing button.

local x, y, z = PedGetOffsetInWorldCoords(gPlayer, 0, 1, 0)
local Russell = PedCreateXYZ(75, x, y, z)
if IsButtonBeingPressed(3, 0) then
PedDelete(Russell)
end

See Also