# CFX::GET_STATE_BAG_VALUE

- **Hash:** `0x637F4C75`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetStateBagValue`
- **Side:** shared (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_STATE_BAG_VALUE

## Signature

```c
object GET_STATE_BAG_VALUE(char* bagName, char* key);
```

## Parameters

- `bagName` (`char*`)
- `key` (`char*`)

## Returns

`object` — Value.

## Description

*Source: Cfx.re native reference*

Returns the value of a state bag key.

## Usage

### Lua

```lua
local retval = GetStateBagValue(bagName, key)

-- always available, by hash
local retval = Citizen.InvokeNative(0x637f4c75, bagName, key, Citizen.ResultAsObject2(msgpack.unpack))
```

### JavaScript

```js
const retval = GetStateBagValue(bagName, key);

// by hash
const retval = Citizen.invokeNative('0x637f4c75', bagName, key, Citizen.returnResultAnyway(), Citizen.resultAsObject2());
```

### C#

```csharp
Function.Call((Hash)0x637f4c75, bagName, key);
```

## See also

- [CFX::SET_STATE_BAG_VALUE](https://natives.borderlinerp.com/natives/CFX/SET_STATE_BAG_VALUE.md) — Internal function for setting a state bag value.

*Sources: Cfx.re native reference.*
