> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# debug.setinfo

Modifies metadata fields for the specified function or stack level.

```luau theme={null}
debug.setinfo(func: function | number, infoTable: table): ()
```

## Parameters

| Parameter   | Type       | Description                                           |                                               |
| ----------- | ---------- | ----------------------------------------------------- | --------------------------------------------- |
| `func`      | \`function | number\`                                              | The target function or stack level to modify. |
| `infoTable` | `table`    | A table containing fields to overwrite (like `name`). |                                               |

## Returns

`void`

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  local function test() end
  debug.setinfo(test, { name = "custom_name" })
  print(debug.getinfo(test).name) -- custom_name
  ```

  ```luau Example 2 theme={null}
  debug.setinfo(1, { name = "fake_frame" })
  ```
</CodeGroup>

<Tip>
  Commonly used to spoof traceback output for debugging or stealth.
</Tip>
