🏠Routing Bucket System
🏠 Routing Bucket System
📋 Overview
The Routing Bucket System enables pets to function properly inside apartments, houses, and other instanced areas that use FiveM's routing bucket technology. Players can spawn and interact with their pets anywhere, regardless of which bucket they're in.
Perfect for:
🏘️ Apartment systems (qb-apartments, qbx_properties)
🏡 Housing scripts with instancing
🎮 Custom housing systems using buckets
🔄 Multi-instance gameplay
✨ Key Features
🖥️ Server-Side Spawning
Pets spawned server-side for proper bucket synchronization
🔄 Auto-Sync System
Pets automatically stored/restored on bucket changes
🏠 Full Housing Support
Works with qb-apartments, qbx_properties, ps-housing and more
⚡ Zero Performance Impact
Minimal server overhead (~0.01ms per spawn)
Complete Feature List
✅ Server-Side Pet Spawning - Pets spawned on server for bucket compatibility
✅ Auto-Store on Bucket Change - Pets automatically stored when changing buckets
✅ Apartment/House Support - Full compatibility with housing scripts
✅ Seamless Transitions - Smooth pet handling across bucket changes
✅ Framework Agnostic - Works with any framework or housing system
✅ Backward Compatible - Existing pets work without migration
✅ Performance Optimized - Minimal impact on server performance
🎮 How It Works
Understanding Routing Buckets
Common Use Cases:
🏠 Apartments
Each apartment is a separate bucket
Only people inside see each other
Prevents interference from outside players
🏡 Houses
Private instances for property owners
Isolated from main world
Multiple houses can exist in same location
🎮 Custom Instances
Special events or missions
PvP arenas
Admin areas
How Buckets Work
Default World (Bucket 0):
All players spawn here by default Main city, streets, public áreas
Apartment Example (Bucket 5):
Player enters apartment → Moved to bucket 5 Only players in bucket 5 can see each other Player exits → Returns to bucket 0
Complete System Flow
Step-by-Step Process:
Player in Main World (Bucket 0)
Player has pet spawned Pet visible to everyone in bucket 0
Player Enters Apartment
Housing script changes bucket (0 → 5) Pet Manager detects bucket change If AutoSyncBucket = true → Pet auto-stored
Inside Apartment (Bucket 5)
Player spawns pet normally Pet spawns in bucket 5 (server-side) Pet visible only to players in bucket 5
Player Exits Apartment
Housing script returns to bucket 0 Pet Manager detects bucket change Pet auto-stored again
Back in Main World
Player can spawn pet normally Pet spawns in bucket 0 Everything works as before
System Configuration
You can find this configs inside the file config.lua:
Configuration Options
UseServerSideSpawning
true
✅ Pets spawn server-side, work in all buckets
false
❌ Pets spawn client-side, won't work in apartments
When to use true:
You have apartment/housing scripts
You use any system with routing buckets
You want maximum compatibility
When to use false:
When you don't use any RoutingBucket System , and need better perfomance
AutoSyncBucket
true
✅ Pet auto-stored on bucket change (recommended)
false
⚠️ Pet may glitch/become invisible on bucket change
When to use true:
You want automatic, seamless behavior
You don't want players to manually store pets
Best user experience (recommended)
When to use false:
You want manual control over pet storage
Custom implementation needed
Advanced use cases only
🔧 Installation
🏘️ Housing Compatibility
Supported Scripts
vms-housing
✅ Tested
Full compatibility, works out of box
qbx_properties
✅ Tested
Full compatibility, works out of box
ps-housing
✅ Compatible
Should work with default config
Custom Scripts
✅ Compatible
Works with any script using routing buckets
📊 Performance
Server Impact
Measurements:
Pet Spawn (Server-Side)
~0.01ms
Negligible
Bucket Change Detection
~0.001ms
Negligible
Auto-Store Pet
~0.005ms
Negligible
Comparison:
Pet Spawn
~0.01ms
~0.001ms
+0.009ms per spawn (insignificant)
Bucket Change Detection
~0.001ms
No additional
+0.001ms per pet spawned in server-side
Auto-Store Pet
~0.005ms
No additional
+0.005ms per pet spawned in server-side
Client Impact
Same resource usage as before
No additional rendering cost
No FPS impact
🔍 Troubleshooting
Problem: Pet disappears when entering apartment
Symptoms:
Pet visible in main world
Pet disappears when entering apartment
No errors in console
Solution:
Enable Auto-Sync:
Verify Server-Side Spawning:
Restart Resources:
Test Again:
Spawn pet in main world
Enter apartment
Pet should auto-store (check inventory/menu)
Spawn pet inside apartment
Problem: Pet not visible to other players in apartment
Symptoms:
You see your pet
Other players don't see your pet
They're in same apartment
Solution:
Check Server-Side Spawning:
Verify Both Players in Same Bucket:
Both should be in same bucket number
Check Console for Errors:
Look for pet spawn errors
Check server console
Restart Resources:
📚 FAQ
Last updated