shared
DeleteEntity
FiveM shared native documentation with a Lua example.
Summary
Removes an entity from the world. Used to clean up spawned vehicles, objects, and peds. On networked entities, delete on the owner or server.
Returns
void
Parameters
entitynumberThe entity handle (passed by reference in some runtimes).Example
if DoesEntityExist(veh) then
DeleteEntity(veh)
endCommon pitfalls
- Check DoesEntityExist first to avoid errors on stale handles.
- For networked entities, deletion must happen where you have control (owner/server) or it may not sync.
Related natives
Related guides
Need protected areas on your map?
Viper Safe-Zone draws polygon safe zones in-game — no hand-edited coordinates — with weapon, combat and vehicle-speed rules per zone.
See Viper Safe-Zone →