routing bucketsinstancesonesync9 min read · updated 9/11/2026

Using routing buckets for instances

Routing buckets split one server into separate worlds: players and entities in bucket 5 never see bucket 0. They are how apartments feel private, how character creation hides you from the city, and how one server runs several PvP arenas at once.

Short answer: On the server, move players with SetPlayerRoutingBucket(src, bucket) and entities with SetEntityRoutingBucket(entity, bucket); read them with GetPlayerRoutingBucket / GetEntityRoutingBucket. Disable AI population in a bucket with SetRoutingBucketPopulationEnabled(bucket, false) and set its entity lockdown with SetRoutingBucketEntityLockdownMode. Bucket 0 is the normal world — always return players there when they leave.

FiveM Routing Buckets: Instances, Apartments and Arenas

#Moving players and entities

server.lua — a private apartment instance
local function enterInstance(src, id)
    local bucket = 1000 + id
    SetRoutingBucketPopulationEnabled(bucket, false)
    SetRoutingBucketEntityLockdownMode(bucket, 'strict')
    SetPlayerRoutingBucket(src, bucket)
end

local function leaveInstance(src)
    SetPlayerRoutingBucket(src, 0)
end

Entities must be moved separately: a player who enters an instance in a car should have the car moved with SetEntityRoutingBucket too, or they arrive without it.

#Typical uses

UseBucket plan
Character creation / multicharacterOne bucket per player while choosing
Apartments and housesOne bucket per property instance
PvP arenasOne bucket per match
EventsA dedicated bucket so the city is not affected

#Gotchas

  • Voice: whether players in different buckets hear each other depends on your voice resource — test it.
  • Scripts that loop over “nearby players” on the client only see their own bucket — usually what you want.
  • Server-created entities start in bucket 0 unless moved.
  • Track who is in which bucket so a crash or disconnect does not leave data behind.

Buckets require OneSync — see OneSync explained. Server-side spawning: server-side entities.

Questions

What is a routing bucket in FiveM?
A separate virtual world on the same server. Players and entities only see others in the same bucket.
How do I put a player in an instance?
On the server: SetPlayerRoutingBucket(source, bucketId); return them with bucket 0.
How do I stop traffic spawning in an instance?
SetRoutingBucketPopulationEnabled(bucketId, false).
Why did my car not come with me into the instance?
Entities are moved separately with SetEntityRoutingBucket.

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.