> For the complete documentation index, see [llms.txt](https://zzerexx.gitbook.io/universal-script-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zzerexx.gitbook.io/universal-script-api/universal-esp.md).

# Universal Esp

## Instance Esp

### Label

{% tabs %}
{% tab title="Usage" %}

```javascript
<object> esp.Label(<Instance> Part, <table> Options)
```

{% endtab %}

{% tab title="Example" %}

```lua
local Label = esp.Label(workspace.Part, {
    Text = "cool part"
})
```

{% endtab %}

{% tab title="Options" %}

| Name          | Description                                        | Type         |
| ------------- | -------------------------------------------------- | ------------ |
| Text          | The text displayed on the Label.                   | String       |
| Transparency  | The Label's transparency. (Number between 0 and 1) | Number       |
| Color         | The Label's color.                                 | Color3       |
| RainbowColor  | If enabled, the color will be Rainbow.             | Boolean      |
| Size          | The Label's text size.                             | Number       |
| Outline       | If enabled, the Label will have an outline.        | Boolean      |
| OutlineColor  | The outline's color.                               | Color3       |
| Font          | The Label's font.                                  | Drawing.Font |
| Offset        | The Label's offset.                                | Vector2      |
| {% endtab %}  |                                                    |              |
| {% endtabs %} |                                                    |              |

Adds a `Label` to the specified `Part`.

### Chams

{% tabs %}
{% tab title="Usage" %}

```javascript
<object> esp.Cham(<Instance> Part, <table> Options)
```

{% endtab %}

{% tab title="Example" %}

```lua
local Cham = esp.Cham(workspace.Part, {
    Color = Color3.fromRGB(0, 170, 255),
    Filled = true
})
```

{% endtab %}

{% tab title="Options" %}

| Name          | Description                                                                                   | Type    |
| ------------- | --------------------------------------------------------------------------------------------- | ------- |
| Transparency  | The Chams' transparency.                                                                      | Number  |
| Color         | The Chams' color.                                                                             | Color3  |
| RainbowColor  | If enabled, the color will be Rainbow.                                                        | Boolean |
| Thickness     | The thickness of the lines on the Chams. This will only be visible when `Filled` is disabled. | Number  |
| Filled        | If enabled, the Chams' will be filled.                                                        | Boolean |
| {% endtab %}  |                                                                                               |         |
| {% endtabs %} |                                                                                               |         |

Adds Chams to the specified Part.

{% hint style="info" %}
You don't need to set all of the options. If they aren't provided, they will be set to the default option.

Additionally, labels and chams also support other instances such as:

* Model
* BasePart
* MeshPart
* WedgePart
* CornerWedgePart
* TrussPart
* PartOperation
* UnionOperation
* NegateOperation
  {% endhint %}

### Set Part

{% tabs %}
{% tab title="Usage" %}

```javascript
<void> object:SetPart(<Instance> Part)
```

{% endtab %}

{% tab title="Example" %}

```lua
local Label = esp.Label(workspace.Part)

task.wait(3)

Label:SetPart(workspace.OtherPart) -- Works the same with Chams!
```

{% endtab %}
{% endtabs %}

Sets the Label/Chams' target part to the specified `Part`.

### Set Property

{% tabs %}
{% tab title="Usage" %}

```javascript
<void> object:SetProp(<string> Property, <variant> Value)
```

{% endtab %}

{% tab title="Example" %}

```lua
local Label = esp.Label(workspace.Part)
Label:SetProp("Font", Drawing.Fonts.Plex)
```

{% endtab %}
{% endtabs %}

Sets the Label/Chams' `Property` to `Value`.

## Set All

{% tabs %}
{% tab title="Usage" %}

```javascript
<void> esp:SetAll(<string> Option, <variant> Value)
```

{% endtab %}

{% tab title="Example" %}

```lua
esp:SetAll("Color", Color3.fromRGB(0, 255, 0)) -- Sets all colors to green
```

{% endtab %}

{% tab title="Supported Options" %}
The following options are supported:

* Enabled
* Transparency
* Color
* UseTeamColor
* RainbowColor
* Outline
* OutlineColor
* OutlineThickness
  {% endtab %}
  {% endtabs %}

Sets all esp types' `Option` to the specified `Value`.

## Get Objects

{% tabs %}
{% tab title="Usage" %}

```javascript
<table> esp:GetObjects(<Player, string> Player?)
```

{% endtab %}

{% tab title="Example" %}

```lua
local Objects = esp:GetObjects("Roblox") -- Accepts either the player's name or the Player object
table.foreach(Objects, print)

-- You can also use this function to remove specific objects
esp:GetObjects(game.Players.Roblox).Box:Remove()
```

{% endtab %}
{% endtabs %}

Returns a table of all Esp objects.\
If a `Player` is specified, it will only return objects that belong to that player.\
The `Player` parameter can be the player's name or the Player object.

## Get Total Objects

{% tabs %}
{% tab title="Usage" %}

```javascript
<table> esp:GetTotalObjects()
```

{% endtab %}

{% tab title="Example" %}

```lua
local Objects = esp:GetObjects("Roblox") -- Accepts either the player's name or the Player object
table.foreach(Objects, print)

-- You can also use this function to remove specific objects
esp:GetObjects(game.Players.Roblox).Box:Remove()
```

{% endtab %}
{% endtabs %}

Returns a table of the total number of objects in each category.

Categories include:

* DrawingObjects
* VisibleObjects
* DestroyedObjects
* NPCObjects
* Boxes
* Tracers
* Names
* Skeletons
* HealthBars
* HeadDots
* LookTracers
* Labels
* Chams
* Outlines

## Get Objects From Id

{% tabs %}
{% tab title="Usage" %}

```javascript
<object> esp:GetObjectsFromId(<number> Id)
```

{% endtab %}

{% tab title="Example" %}

```lua
local Objects = esp:GetObjects("Roblox") -- Accepts either the player's name or the Player object
table.foreach(Objects, print)

-- You can also use this function to remove specific objects
esp:GetObjects(game.Players.Roblox).Box:Remove()
```

{% endtab %}
{% endtabs %}

Returns an esp object with the given `Id`.

## Add Esp

{% tabs %}
{% tab title="Usage" %}

```javascript
<void> esp:Add(<Instance, string> Player)
```

{% endtab %}

{% tab title="Example" %}

```lua
esp:Add("Roblox")

esp:Add(workspace.Dummy) -- Works on Models! These will be considered NPCs.
```

{% endtab %}
{% endtabs %}

Adds Esp to the specified `Player`.\
The `Player` parameter can be the player's name or the Player object.\
If the `Player` parameter is a Model, it will be considered an NPC. NPC esp will use the settings from the `NPC` Type.

## Remove Esp

{% tabs %}
{% tab title="Usage" %}

```javascript
<void> esp:Remove(<Instance, string> Player)
```

{% endtab %}

{% tab title="Example" %}

```lua
esp:Add("Roblox")

esp:Add(workspace.Dummy) -- Works on Models! These will be considered NPCs.
```

{% endtab %}
{% endtabs %}

Removes Esp from the specified `Player`.\
The `Player` parameter can be the player's name or the Player object.\
If the `Player` parameter is a Model, it will be considered an NPC.

## Remove

{% tabs %}
{% tab title="Usage" %}

```javascript
<void> object:Remove(<void>)
```

{% endtab %}

{% tab title="Example" %}

```lua
esp:GetObjects("Roblox").Box:Remove()
```

{% endtab %}
{% endtabs %}

Remove the specified `object`.
