pools
Enumerate current entity handles and inspect available pool counts.
pools.get(kind[, limit]) returns a 1-based table of current script entity handles through the shared pool utility. kind is "peds", "vehicles", "objects", or "pickups"; limit defaults to 4096 and must be 1..4096. Unavailable enumeration returns an empty table. pools.count(kind) returns the pool's current count or nil when its binding is unavailable; it does not create handles. A bounded handle list may contain fewer entries than that count.
lua
for _, ped in ipairs(pools.get("peds", 128)) do
if natives.entity.does_entity_exist(ped) then
-- Use the handle synchronously here.
end
endNo pool pointers escape the call. Handles must be revalidated after yields, despawns or session changes.