# Statebags

As mentioned previously, chaser is synced and uses statebags to do so, chaser statebags are as follow:

## currentgear <a href="#docs-internal-guid-7d394f02-7fff-f7c1-3cf6-bc1382e3ca30" id="docs-internal-guid-7d394f02-7fff-f7c1-3cf6-bc1382e3ca30"></a>

This Statebag is responsible for keeping the data necessary for transmission syncronization, alongside the current vehicle gear, and you can access it to show the current gear on your speedometer

```lua
gear = Entity(entity).state.currentgear[1]
```

## currentengine <a href="#docs-internal-guid-7d394f02-7fff-f7c1-3cf6-bc1382e3ca30" id="docs-internal-guid-7d394f02-7fff-f7c1-3cf6-bc1382e3ca30"></a>

This Statebag is responsible for keeping the data necessary for engine syncronization, alongside the current audiohash, and you can access it to show the current gear on your speedometer

```lua
currentengine = Entity(entity).state.currentengine[1]
currentaudiohash = Entity(entity).state.currentengine[2]
```

## dumpvalvefired <a href="#docs-internal-guid-7d394f02-7fff-f7c1-3cf6-bc1382e3ca30" id="docs-internal-guid-7d394f02-7fff-f7c1-3cf6-bc1382e3ca30"></a>

A State bag which can be used to playback a dumpvalve sound when chaser turbo system dumpvalve is fired using statebagchangehandler example:

```lua
AddStateBagChangeHandler("dumpvalvefired", nil, function(bagName, key, value)
    local entity = GetEntityFromStateBagName(bagName)


    if DoesEntityExist(GetPedInVehicleSeat(entity, -1)) then
       
    local dumpvalve = value
   
    if entity ~= 0 and GetPedInVehicleSeat(vehicle, -1) ~= player then
        if dumpvalve == true then -- if dumpvalve was fired
            PlayTurboSound("dumpvalve_01") -- here you call your function to play your dumpvalve sound
            Entity(entity).state:set('dumpvalvefired',false,true) -- set the state to false again, for the                   
                                                                     next release.
        end
    end


end)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legacydmc.gitbook.io/chaser/networking/statebags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
