# SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH

- **Hash:** `0x8E34C953364A76DD`
- **Namespace:** SCRIPT
- **Runtime name (Lua/JS):** `GetNumberOfThreadsRunningTheScriptWithThisHash`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/SCRIPT/GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH

## Signature

```c
int GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(Hash scriptHash);
```

## Parameters

- `scriptHash` (`Hash`)

## Returns

`int`

## Description

Gets the number of instances of the specified script is currently running.

Actually returns numRefs - 1.
if (program)
	v3 = rage::scrProgram::GetNumRefs(program) - 1;
return v3;

Old name: _GET_NUMBER_OF_REFERENCES_OF_SCRIPT_WITH_NAME_HASH

## Usage

### Lua

```lua
local retval = GetNumberOfThreadsRunningTheScriptWithThisHash(scriptHash)

-- always available, by hash
local retval = Citizen.InvokeNative(0x8E34C953364A76DD, scriptHash, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetNumberOfThreadsRunningTheScriptWithThisHash(scriptHash);

// by hash
const retval = Citizen.invokeNative('0x8E34C953364A76DD', scriptHash, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x8E34C953364A76DD, scriptHash);
```

- Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat("name")` or a backtick literal like `` `name` ``.

*Sources: alloc8or RDR3 NativeDB.*
