# BRAIN::_START_SCRIPT_BRAIN

- **Hash:** `0x6F62FAE266DCFC81`
- **Namespace:** BRAIN
- **Runtime name (Lua/JS):** `StartScriptBrain`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/BRAIN/_START_SCRIPT_BRAIN

## Signature

```c
int _START_SCRIPT_BRAIN(Entity entity, const char* scriptName, int p2, Any* p3, int p4, BOOL p5);
```

## Parameters

- `entity` (`Entity`)
- `scriptName` (`const char*`)
- `p2` (`int`)
- `p3` (`Any*`)
- `p4` (`int`)
- `p5` (`BOOL`)

## Returns

`int`

## Description

Returns threadId

## Usage

### Lua

```lua
local retval, p3 = StartScriptBrain(entity, scriptName, p2, p4, p5)

-- always available, by hash
local retval, p3 = Citizen.InvokeNative(0x6F62FAE266DCFC81, entity, scriptName, p2, Citizen.PointerValueInt(), p4, p5, Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, p3] = StartScriptBrain(entity, scriptName, p2, p4, p5);

// by hash
const [retval, p3] = Citizen.invokeNative('0x6F62FAE266DCFC81', entity, scriptName, p2, Citizen.pointerValueInt(), p4, p5, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
var p3 = new OutputArgument();
int retval = Function.Call<int>((Hash)0x6F62FAE266DCFC81, entity, scriptName, p2, p3, p4, p5);
// p3.GetResult<int>()
```

- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.
- The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works.

*Sources: alloc8or RDR3 NativeDB.*
