client
SetPedAsNoLongerNeeded / SetEntityAsNoLongerNeeded
FiveM client native documentation with a Lua example.
Summary
Tells the engine it can clean up an entity you no longer control, preventing leaks of spawned peds/vehicles/objects.
Returns
void
Parameters
entitynumberThe entity handle (by reference).Example
local ped = CreatePed(...)
-- use it
SetPedAsNoLongerNeeded(ped)Common pitfalls
- Call after you're done with a spawned entity you don't need to manage.
- Not the same as deleting — it lets the engine clean up naturally.
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 →