[Help] Is there any way to "despawn" peds from client when this one is away (onesync)?

Hi there :wave: !

We’re looking for a way to load NPC peds only when the player is close to them.
We’re running a 300+ active players each nights, and spawning peds for missions etc. is leading to some ran out of ped pool space while creating network object errors.

We’re of course using OneSync.

Thanks and happy new year !
Stay safe.

Congrats on 300+ members a night! And I don’t think there is a way though. Just check the fivem Forum, and any other FiveM resources like github.

Thanks mate, that’s quite a lot for a french RP server haha.
Already spent hours reading about this but I can’t find what I’m looking for.

Why not create an entity management script that creates and destroys the entity when they are within range, you’d queue the creation of an entity till its required or meets a condition.

Yup that’s exactly what we’ve build haha