---
title: "setidentity"
description: "Updates the calling thread's identity and capabilities through the scheduler."
---

```lua
setidentity(identity: number): ()
```

---

## Aliases

- `setthreadidentity`
- `setthreadcontext`

---

## Arguments

<ParamField body="identity" type="number" required>
  The numeric thread identity.
</ParamField>

---

## Returns

This function returns no values.

Identity is per-thread and client-dependent. This wrapper does not validate an allowed numeric range.

---

## Example

```lua
local previous = getidentity()
setidentity(previous)
```
