---
title: "getrenv"
description: "Returns a cached shallow clone of the main Roblox global environment."
---

```lua
getrenv(): table
```

---

## Aliases

- `getrobloxenv`

---

## Arguments

This function takes no arguments.

---

## Returns

<ResponseField name="environment" type="table">
  The cached shallow clone of the main Roblox global environment.
</ResponseField>

The clone is reused in the same main VM; nested tables remain shared. It is not a fresh deep snapshot.

---

## Example

```lua
local env = getrenv()
print(type(env.print), type(env.shared))
```
