setuntouched
Sets the environment’s Luau safe-environment flag.
Syntax
setuntouched(env: table, untouched: boolean) -> ()
Also available as
set_un_touched
Parameters
| Parameter | Type | Description |
|---|---|---|
env | table | Environment table. |
untouched | boolean | New safe-environment flag. |
Description
Marking an environment untouched tells the VM it can trust optimized builtin imports. Do not set it to true after replacing builtins unless the environment satisfies those assumptions; optimized and ordinary lookups may otherwise disagree. This does not freeze the table.
Example
local env = getfenv()
setuntouched(env, false)
print(isuntouched(env))
These are Game executor contracts. Check build requirements and session lifetimes before using them.
