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
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 →