# What OneSync does and how to configure it

> Understand OneSync on FiveM: server-side state awareness, on vs legacy vs off, Infinity for big player counts and what changes for your scripts.

Source: https://fam-tools.com/guides/fivem-onesync-infinity · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 9 min

**Short answer.** Set `set onesync on` in server.cfg. “On” gives full state awareness and server-determined routing; “legacy” is a compatibility mode for old scripts that expect every player to exist on every client and is not recommended; “off” disables it. Infinity (`onesync_enableInfinity`, default true) is needed for large player counts — more than 64 slots require OneSync on. It also enables server-side entity natives, entity lockdown and routing buckets.

## Key points

- `set onesync on` for every modern server.
- Legacy mode only for very old scripts.
- > 32 slots need OneSync; > 64 need `on`.
- Clients only know nearby entities — scripts must not assume otherwise.
- Enables server-side natives, lockdown and buckets.

OneSync is FiveM’s server-side synchronisation. Without it, clients sync with each other through the server as a relay; with it, the server knows about every entity and decides what each player receives. Almost every modern script expects it, and large player counts require it.

## The modes

*From Cfx.re’s server command documentation.*

| Mode | Meaning |
| --- | --- |
| `on` | Full state awareness; the server routes entities to players |
| `legacy` | Compatibility for scripts that expect all players on every client; not recommended |
| `off` | No state awareness; peer-to-peer style relay |

## Related convars

| Convar | Default | Effect |
| --- | --- | --- |
| `onesync_enableInfinity` | true | Large-scale entity sync; startup only |
| `onesync_population` | true | AI population (traffic, peds) |
| `onesync_distanceCulling` | true | Stops syncing far, out-of-view entities |
| `onesync_distanceCullVehicles` | false | Applies culling to vehicles too |
| `onesync_forceMigration` | true | Migrates entities when the owner leaves |

## What changes for scripts

- A client only knows players and entities near it — `GetActivePlayers()` is not everyone on the server.
- Send network IDs, not handles — see [entity ownership](https://pityus.net/guides/fivem-entity-ownership-network-ids).
- Many natives work on the server: `GetEntityCoords`, `SetEntityCoords`, `CreateVehicleServerSetter`…
- Player data for distant players should come from the server (state bags, events).

## Features that need OneSync

- More than 32 player slots — see [max players](https://fam-tools.com/guides/fivem-max-players-slots).
- `sv_entityLockdown` against spawned entities.
- Routing buckets — see [routing buckets](https://fam-tools.com/guides/fivem-routing-buckets).
- Server-side game event filtering (explosions, weapon damage).

## Questions

### How do I enable OneSync?

Add `set onesync on` to server.cfg (txAdmin recipes usually set it for you).

### What is OneSync Infinity?

The large-scale entity sync mode, enabled by default with `onesync_enableInfinity`; required for big player counts.

### Should I use onesync legacy?

Only for old scripts that cannot handle state awareness; it has performance and visual issues.

### Why can my script not see all players?

With OneSync, clients only know nearby players. Get server-wide data from the server.

## Related

- https://fam-tools.com/guides/fivem-max-players-slots
- https://fam-tools.com/guides/fivem-routing-buckets
- https://fam-tools.com/guides/fivem-entity-limits-cleanup
- https://fam-tools.com/guides/fivem-desync-network-issues
