# Instance

## fireclickdetector

```lua
<nil> fireclickdetector(<ClickDetector> object, <number?> distance)
```

Dispatches a click or hover event to the given ClickDetector. When absent, `distance` defaults to zero.

```lua
local clickDetector = workspace.Door.Button.ClickDetector
fireclickdetector(clickDetector, 10 + math.random())
```

***

## firetouchinterest

```lua
<nil> firetouchinterest(<Instance> instance, <Instance> touchingPart, <bool> isTouching)
```

Simulates a touch event between two parts.

```lua
local rootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
firetouchinterest(workspace.TouchPart, rootPart, true)
firetouchinterest(workspace.TouchPart, rootPart, false)
```

***

## isnetworkowner

```lua
<bool> isnetworkowner(<Instance> part)
```

Returns `true` if the Part is owned by the player.

***

## getcallbackvalue

```lua
<function?> getcallbackvalue(<Instance> object, <string> property)
```

Returns the function assigned to a callback property of `object`, which cannot be indexed normally.

***

## fireproximityprompt

```lua
<nil> fireproximityprompt(<ProximityPrompt> prompt)
```

Fires the trigger of `prompt`.

***

## getconnections

```lua
<table<ConnectionObject>> getconnections(<RBXScriptSignal> signal)
```

Creates a list of Connection objects for the functions connected to `signal`.

| Field           | Type      | Description                                                                    |
| --------------- | --------- | ------------------------------------------------------------------------------ |
| `Enabled`       | boolean   | Whether the connection can receive events.                                     |
| `ForeignState`  | boolean   | Whether the function was connected by a foreign Luau state (i.e. CoreScripts). |
| `LuaConnection` | boolean   | Whether the connection was created in Luau code.                               |
| `Function`      | function? | The function bound to this connection. Nil when `ForeignState` is true.        |
| `Thread`        | thread?   | The thread that created the connection. Nil when `ForeignState` is true.       |

| Method                | Description                                                                                                                          |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `Fire(...: any): ()`  | Fires this connection with the provided arguments.                                                                                   |
| `Defer(...: any): ()` | [Defers](https://devforum.roblox.com/t/beta-deferred-lua-event-handling/1240569) an event to connection with the provided arguments. |
| `Disconnect(): ()`    | Disconnects the connection.                                                                                                          |
| `Disable(): ()`       | Prevents the connection from firing.                                                                                                 |
| `Enable(): ()`        | Allows the connection to fire if it was previously disabled.                                                                         |

***

## getconnection

```lua
<table<ConnectionObject>> getconnection(<RBXScriptSignal> signal, <number> index)
```

Returns a Connection object for `index` .

***

## firesignal

```lua
<nil> firesignal(<RBXScriptSignal> signal, ...)
```

Fires all Lua connections of `signal` .

***

## getcustomasset

```lua
<string> getcustomasset(<string> path)
```

Returns a `rbxasset://` content id for the asset located at `path`, allowing you to use unmoderated assets. Internally, files are copied to the game's content directory.

***

## gethiddenproperty

```lua
<any, boolean> gethiddenproperty(<Instance> object, <string> property)
```

Returns the value of a hidden property of `object`, which cannot be indexed normally.

If the property is hidden, the second return value will be `true`. Otherwise, it will be `false`.

```lua
local fire = Instance.new("Fire")
print(gethiddenproperty(fire, "size_xml")) --> 5, true
print(gethiddenproperty(fire, "Size")) --> 5, false
```

***

## setsimulationradius

```lua
<nil> setsimulationradius(<number> simulationRadius, <number?> maxSimulationRadius)  
```

Sets the player's simulationRadius. If `maxSimulationRadius` is specified, it will set that as well.

***

## gethui

```lua
<Folder> gethui()
```

Returns a hidden GUI container. Should be used as an alternative to CoreGui and PlayerGui.

GUI objects parented to this container will be protected from common detection methods.

***

## getinstances

```lua
<table<Instance>> getinstances()
```

Returns a list of every Instance referenced on the client.

***

## getnilinstances

```lua
<table<Instance>> getnilinstances()
```

Like `getinstances`, but only includes Instances that are not descendants of a service provider.

***

## isscriptable

```lua
<boolean> isscriptable(<Instance> object, <string> property)
```

Returns whether the given property is scriptable (does not have the `notscriptable` tag).

If `true`, the property is scriptable and can be indexed normally. If `nil`, the property does not exist.

***

## sethiddenproperty

```lua
<boolean> sethiddenproperty(<Instance> object, <string> property, <any> value)
```

Sets the value of a hidden property of `object`, which cannot be set normally. Returns whether the property was hidden.

```lua
local fire = Instance.new("Fire")
print(sethiddenproperty(fire, "Size", 5)) --> false (not hidden)
print(sethiddenproperty(fire, "size_xml", 15)) --> true (hidden)
print(gethiddenproperty(fire, "size_xml")) --> 15, true (hidden)
```

***

## setrbxclipboard

```lua
<boolean> setrbxclipboard(<string> data)
```

Sets the Studio client's clipboard to the given `rbxm` or `rbxmx` model data. This allows data from the game to be copied into a Studio client.

```lua
local data = readfile("model.rbxm")
setrbxclipboard(data) -- Can be pasted into Studio
```

***

## setscriptable

```lua
<boolean> setscriptable(<Instance> object, <string> property, <boolean> value)
```

Set whether the given property is scriptable. Returns whether the property was scriptable prior to changing it.

***

## getrendersteppedlist

```lua
<table> getrendersteppedlist()
```

Returns all callbacks bound with `RunService.BindToRenderStep` .

***

## replicatesignal

```lua
<nil> replicatesignal(<RBXScriptSignal> signal, ...)
```

Replicates `signal` on the server.

&#x20;If `signal` has one or multiple arguments, they must be provided in the call.

```lua
replicatesignal(game.Players.LocalPlayer.Kill) --> Kills you

local sword = game.Players.LocalPlayer.Character.ClassicSword
replicatesignal(sword.Activated) --> Swings the sword
```

***


---

# Agent Instructions: 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:

```
GET https://potassium.gitbook.io/api/environment/instance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
