Zea Development - Documentation
StoreWebsiteDiscord
  • Welcome
  • General
    • Downloading Resources
    • Transferring Resources
    • Resource Support
    • Escrow Errors
    • Statebags
    • Artifacts & Gamebuilds
  • Our Resources
    • z_hose
      • Resource Configuration
        • Configuration Modules
      • Compatibility with ox_inventory
      • Resource Usage
      • Developer Resources
        • Client Exports
        • Server Exports
    • z_ladders
      • Resource Configuration
        • Configuring Vehicle
        • Configuring Ladders
      • Developer Resources
        • Client Exports
    • z_fire
      • Resource Configuration
      • JSON Configuration
      • Resource Usage
      • Developer Exports
      • Materials List
    • z_els
      • Resource Configuration
      • Resource Usage
      • Developer Exports
      • Creating Patterns
      • Directional Types
    • z_boot (Coming Soon!)
      • Resource Configuration
        • Configuration Modules
        • Item Creation
      • Developer Resources
        • Client Exports
    • z_ppvfan
      • Resource Configuration
      • Resource Usage
    • zTurnout-System
      • Resource Configuration
      • Resource Usage
      • Trigger Events
    • zWigWags
      • Resource Configuration
      • Resource Usage
      • Trigger Events
    • zFire-Alarm
      • Resource Configuration
      • Resource Usage
    • zCustody-Alarm
      • Resource Configuration
      • Resource Usage
    • zFire-Pole
      • Resource Configuration
      • Resource Usage
    • zTurnout-Rack
      • Resource Configuration
      • Resource Usage
    • zPager
      • Resource Configuration
      • Resource Usage
    • zTurnouts
      • Resource Configuration
      • Resource Usage
Powered by GitBook
On this page
Page cover
  1. General

Statebags

This page will assist you in understanding statebags within FiveM, as well as addressing any errors you may encounter during their use.

PreviousEscrow ErrorsNextArtifacts & Gamebuilds

Last updated 25 days ago

CtrlK
  • What is a statebag?
  • Statebag errors
  • What can we do about these errors?

What is a statebag?

A Statebag is a server-side data structure in FiveM used to manage and synchronize state-related information for players or server entities. It allows developers to store and update session-specific data—such as inventory, vehicle status, or player progression—without requiring constant communication between the server and client.

Although Statebags are stored on the server, their contents can be accessed and modified by both the server and the client, as long as proper synchronization is maintained. This makes them a powerful tool for efficiently managing dynamic gameplay data across networked sessions.


Statebag errors

By default, Statebags in FiveM are subject to rate limits. This means if too many updates are sent in a short period, the server may throttle or reject them—potentially causing unexpected behaviour or performance issues.

When these rate limits are exceeded, the server may:

  • Reject the updates, leading to inconsistent game state or errors.

  • In severe cases, kick the player from the server.

To maintain stable performance and avoid disruptions, it's important to understand these limits and implement proper throttling or debounce mechanisms in your scripts.

What can we do about these errors?

To address issues caused by Statebag rate limiting, you can adjust the server’s rate limit settings to allow more frequent updates. This ensures that Statebag changes have enough headroom to be processed without being rejected or throttled.

Add the following lines to your server.cfg file:

set rateLimiter_stateBag_rate 2000
set rateLimiter_stateBag_burst 3000
  • rateLimiter_stateBag_rate defines how many updates per second are allowed.

  • rateLimiter_stateBag_burst sets how many updates can be sent in a short burst before throttling begins.

Adjust these values carefully based on your server’s performance and the intensity of your gameplay features. Keep in mind that raising them too high may introduce unnecessary network overhead or potential abuse if not managed properly.