> For the complete documentation index, see [llms.txt](https://duckys-playground.gitbook.io/wave/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://duckys-playground.gitbook.io/wave/functions/environment.md).

# Environment

### Add Spy Callback

{% code lineNumbers="true" %}

```typescript
<void> addspycallback(<function callback>)
```

{% endcode %}

* Registers a `callback` that will be executed whenever a RemoteEvent or function is invoked, allowing you to inspect or log the call.

***

### Create Secure Folder

```typescript
<void> createsecurefolder(<string> path)
```

* Creates a new secure folder to `path`.

> Note: The folder itself won't be able to be found by the game. This means you don't need to set the security of the instances within it.

> Alternative:  `create_secure_folder`

### Fire Click Detector

{% code lineNumbers="true" %}

```typescript
<void> fireclickdetector(<ClickDetector> ClickDetector, <number?> Distance = 0, <string?>)
```

{% endcode %}

* Fires the `ClickDetector`. If no distance supplied, it will default to `0`.

***

### Fire Proximity Prompt

{% code lineNumbers="true" %}

```typescript
<void> fireproximityprompt(<ProximityPrompt> Prompt)
```

{% endcode %}

* Fires the `ProximityPrompt` trigger.

***

### Fire Touch Interest

{% code lineNumbers="true" %}

```typescript
<void> firetouchinterest(<BasePart> totouch, <BasePart> Part, <uint?> toggle)
```

{% endcode %}

* Touches part with `totouch`.

#### Actions:

|       Action      | Toggle |
| :---------------: | :----: |
| Begins the touch. |    0   |
|  Ends the touch.  |    1   |

***

### Get Instances

{% code lineNumbers="true" %}

```typescript
<table> getinstances(<void>)
```

{% endcode %}

* Returns a `table` with instances.

> Alternative: `get_instances`

***

### Get Nil Instances

{% code lineNumbers="true" %}

```typescript
<table> getnilinstances(<void>)
```

{% endcode %}

* Returns a `table` with instances parented to `nil`.

> Alternative: `get_nil_instances`

***

### Is Secured Instance

```typescript
<void> issecuredinstance(<Instance> Instance)
```

* Returns <mark style="color:green;">`true`</mark>/<mark style="color:red;">`false`</mark> if `Instance` is secured/not secured.

> Alternative: `is_secured_instance`

***

### Protect Instance

{% code lineNumbers="true" %}

```typescript
<void> protectinstance(<Instance obj>)
```

{% endcode %}

* Marks `obj` as protected, preventing it from being tampered with or detected by certain internal checks.

***

### Set Normal Instance

```typescript
<table> setnormalinstance(<Instance> Instance)
```

* Sets `Instance` back to its normal state. Returns <mark style="color:red;">`false`</mark> if `Instance` is back to normal.

> Alternative: `set_normal_instance`

***

### Set Simulation Radius

{% code lineNumbers="true" %}

```typescript
<void> setsimulationradius(<number radius>)
```

{% endcode %}

* Sets the simulation `radius` for the local player, controlling how far physics and character updates are processed around the player.

***

### Set Secure Instance

```typescript
<table> setsecureinstance(<Instance> Instance)
```

* Secures `Instance`. Returns <mark style="color:red;">`false`</mark> if `Instance` is secured.

> Alternative: `set_secure_instance`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://duckys-playground.gitbook.io/wave/functions/environment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
