# Exunys ESP Methods - Documentation

## WrapPlayers

```xml
<void> ExunysDeveloperESP.WrapPlayers(<void>)
```

Wraps every player in the game.

## UnwrapPlayers

```xml
<boolean> Success | ExunysDeveloperESP.UnwrapPlayers(<void>)
```

Unwraps every player that is wrapped in the game.

## Load

```xml
<void> ExunysDeveloperESP.Load(<void>)
```

Wraps every player in the game and renders a crosshair.\
\ <mark style="color:red;">**Note**</mark>: You cannot call this method twice.\
\
Faster alternative, equivalent to `ExunysDeveloperESP()` which uses a **\_\_call** metamethod that proxies this method.

## UnwrapAll

```xml
<boolean> Success | ExunysDeveloperESP:UnwrapAll(<void>)
```

This method unwraps every wrapped object in the script's environment (players, NPCs and parts) and removes the rendered crosshair.\
\
This method will return a result once it is done with everything to allow you to yield your program until you get a response.

***

## RenderCrosshair

```xml
<void> ExunysDeveloperESP.RenderCrosshair(<void>)
```

Draws a crosshair.

## RemoveCrosshair

```xml
<void> ExunysDeveloperESP.RemoveCrosshair(<void>)
```

Removes the drawn crosshair.

***

## GetEntry

```xml
<table> Entry | ExunysDeveloperESP.GetEntry(<Instance> Object[, <string> Hash])
```

Miscellaneous method, returns the entry of the specified `Object` (player or part) which contains core information of the wrapped object like the assigned hash, rig type, name / pseudo name, visuals (render objects), render flags / checks etc.\
\
It is more recommended you use the second parameter, `Hash`, for more precise results. If no entry is found, the method will return **nil**, example:

```lua
ExunysDeveloperESP.GetEntry(nil, Hash) --> <table/nil> Entry / nil 
```

This method could be used for changing some specifics like the **allowed visuals table**.&#x20;

<mark style="color:red;">**Note**</mark>: The allowed visuals table is only used for when it renders the visual, they do not get used while the visual updates. At the current state of the module, you must call the *Restart* method for the changes to take effect.

At the current state for the beta release, this method does not serve a lot of purpose and if you rewrite any of the pointers, the closures responsible for updating the render objects might start to malfunction and show inaccurate results for positions, names, size snapping and etc.

For now, you can only change the render distance of the entry with this method with the following example:

```lua
ExunysDeveloperESP.GetEntry(Hash).RenderDistance = 500
```

***

## WrapObject

```xml
<string> Hash | ExunysDeveloperESP:WrapObject(<Instance> Object[, <string> Pseudo Name, <table> Allowed Visuals, <uint> Render Distance])
```

With this method you can wrap parts, NPCs and players.\
\
For Players:\
\- The parsed `Object` must be an instance of class type **Player**.\
\
For Parts:\
\- The parsed `Object` must be a part, or a model with an available `PrimaryPart`.\
\
For NPCs:\
\- The parsed `Object` can be a part or a model, the script checks its parent or children for any humanoids.

<mark style="color:red;">**Note**</mark>: The **health bar** and **head dot** visual will only apply to NPCs.

This method wraps the specified `Object` in *parameter #1* which displayable name (for the ESP text) can be modified by attaching an optional `Pseudo Name` in *parameter #2*. You can also choose which visuals get rendered by parsing a table, `Allowed Visuals` in *parameter #3* which follows the following format:

```lua
local AllowedVisuals = {
    ESP = true,
    Tracer = true,
    HeadDot = true, -- for NPCs / Players
    Box = true,
    HealthBar = true, -- for NPCs / Players
    Skeleton = true, -- for NPCs / Players
    Highlight = true,
    Chams = true
}
```

Any unspecified values will be counted as set to `true`, meaning you can disable only the visuals you choose, example:

```lua
local AllowedVisuals = {
    Tracer = false -- Will only intercept the rendering of the tracer
}
```

<figure><img src="https://105544945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5eJ8jAjob0bfmTkMgej%2Fuploads%2FbEORsM4jlk6DSu2JtOM2%2Fimage_2023-04-19_213215730.png?alt=media&#x26;token=63624fe4-bd34-4a33-8464-a3f4602de3c5" alt=""><figcaption><p>(THIS IMAGE IS OLD, YOU MUST NAME CALL THIS METHOD) As you can see, in the following image, in the third parameter there is a table parsed with the key <em>Tracer</em> set to <strong>false</strong>. The module doesn't render the tracer for this wrapped object.</p></figcaption></figure>

And for the `Render Distance`, if *parameter #4* is **nil** the value would be set to infinity automatically, this parameter declares if the visual object will be rendered or not if the player is in the specified radius / distance of the object, if not, the visuals will be temporarily disabled until the user meets the allowed radius distance again.

<figure><img src="https://105544945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5eJ8jAjob0bfmTkMgej%2Fuploads%2F4ygMZs1Yh8bQ4ED7mgLb%2F5x8xs3v2.gif?alt=media&#x26;token=3d3563ea-07e8-4eba-a75c-c0fcb51c63d6" alt=""><figcaption><p>This video displays how an object wrapped with a specified render distance looks like, the render distance is set to 100.</p></figcaption></figure>

<figure><img src="https://105544945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5eJ8jAjob0bfmTkMgej%2Fuploads%2FOCqh61vUD6SpGgDn5fAM%2FRobloxPlayerBeta_0qjkqBwiIM.gif?alt=media&#x26;token=ac720cb4-4ba8-4d7d-9d0c-eb8148f9313f" alt=""><figcaption><p>This video demonstrates how to use the <em>GetEntry</em> method to change the render distance. In this video, the render distance is changed from 100 to 110.</p></figcaption></figure>

## UnwrapObject

```xml
<void> ExunysDeveloperESP.UnwrapObject(<Instance> Object, <string> Hash)
```

<mark style="color:red;">**Note**</mark>: For maximal precision, parse a hash when calling this method.\
\
This method unwraps the wrapped entry which gets identified by the parsed `Object` or `Hash`, meaning it destroys every visual and removes them from the entries table. Example code:

```lua
do
    local Hash = ExunysDeveloperESP.WrapObject(workspace.Part, "Cool Part", {Tracer = false}, 500))
    
    task.delay(5, ExunysDeveloperESP.UnwrapObject, Hash)
end
```

***

## Restart

```xml
<void> ExunysDeveloperESP:Restart(<boolean> Rewrite Entries)
```

Performs a quick unwrap & wrap on the already wrapped entries in the environment.\
\
If you call this method and parse `true` as the first argument, the module does a hard restart removing all the entries and applying new hashes. Be warned that this method will remove any manually entered entries like parts and NPCs.\
\ <mark style="color:red;">**Note**</mark>: If the **Rewrite Entries** parameter is set to `true`, this method rewrites every entry's hash.

## Exit

```xml
<void> ExunysDeveloperESP:Exit(<void>)
```

Unwraps every wrapped object, removes the rendered crosshair (if there is one) and unloads the module from the script executor's environment. Technically, this method is used for unloading the module.

***

## UpdateConfiguration

<pre class="language-xml"><code class="lang-xml"><strong>&#x3C;table> New environment | ExunysDeveloperESP.UpdateConfiguration(&#x3C;table> DeveloperSettings, &#x3C;table> Settings, &#x3C;table> Properties)
</strong></code></pre>

This method is used as an auxillary function for the `LoadConfiguration` and `SaveConfiguration` methods. It is not useful for any user occasions since you can just modify the settings yourself by setting a new index. Example:

```lua
ExunysDeveloperESP.Properties.Crosshair.Rotate = true
```

## LoadConfiguration

```xml
<void> ExunysDeveloperESP:LoadConfiguration(<void>)
```

Sets the current settings to the the stored configuration at the specified path found in the developer settings (`ExunysDeveloperESP.DeveloperSettings.Path`).\
\
Both this and the `SaveConfiguration` methods use [Exunys' Config Library](https://github.com/Exunys/Config-Library) which requires your script execution engine to support file system functions like `readfile`, `writefile`, `delfile` etc.

## SaveConfiguration

```xml
<void> ExunysDeveloperESP:SaveConfiguration(<void>)
```

Saves the developer settings, settings and properties tables from the environment as a `.cfg` format (the tables are in JSON format) in the specified path in developer settings.&#x20;
