---
title: "setuntouched"
description: "Updates the native safeenv flag on a table or the environment of a function/thread."
---

```lua
setuntouched(value: table | thread | function, untouched: boolean): ()
```

---

## Aliases

None.

---

## Arguments

<ParamField body="value" type="table | thread | function" required>
  A table, thread, or function whose environment safeenv flag is changed.
</ParamField>

<ParamField body="untouched" type="boolean" required>
  The safe-environment flag to assign.
</ParamField>

---

## Returns

This function returns no values.

This changes VM optimization metadata; it is not a content comparison or change detector.

---

## Example

```lua
local t = {}
setuntouched(t, false)
print(isuntouched(t))
```
