# esp

## Example available!

{% content-ref url="../../useful-information/script-examples/esp" %}
[esp](https://docs-csgo.neverlose.cc/useful-information/script-examples/esp)
{% endcontent-ref %}

## Class names

Available ESP classes: <mark style="color:blue;">`enemy`</mark>, <mark style="color:blue;">`team`</mark>, <mark style="color:blue;">`self`</mark>

## Functions:

### :new\_text

`esp.esp_class:new_text(name: string, preview: string, callback: function):` <mark style="color:purple;">`ESPGroup`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>ESP element picker text</td></tr><tr><td><strong>preview</strong></td><td><strong><code>string</code></strong></td><td>ESP preview text</td></tr><tr><td><strong>callback</strong></td><td><strong><code>function</code></strong></td><td>Function that will be called for each entity while drawing the ESP</td></tr></tbody></table>

Registers ESP text to the specified class. The callback function is called every frame. It is passed an entity pointer. Return a string in order to manage the output.

### :new\_bar

`esp.esp_class:new_bar(name: string, callback: function):` <mark style="color:purple;">`ESPGroup`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>ESP element picker text</td></tr><tr><td><strong>callback</strong></td><td><strong><code>function</code></strong></td><td>Function that will be called for each entity while drawing the ESP</td></tr></tbody></table>

Registers an ESP bar to the specified class. The callback function is called every frame. Access the entity pointer using the arguments of the specified callback. Return a boolean followed by the number in the range \[0.0, 1.0].

### :new\_item

`esp.esp_class:new_item(name: string):` <mark style="color:purple;">`ESPGroup`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>ESP element picker text</td></tr></tbody></table>

Registers an ESP item that is neither text nor a bar.

#### 🔗 struct <mark style="color:blue;">`ESPGroup`</mark>

<table><thead><tr><th width="160.7500302222433">Name</th><th width="150">Type</th><th width="420.1829205510523">Description</th></tr></thead><tbody><tr><td><strong>get</strong></td><td><strong><code>function</code></strong></td><td>Returns the value of the item.</td></tr><tr><td><strong>set</strong></td><td><strong><code>function</code></strong></td><td>Sets the value of the item.</td></tr><tr><td><strong>name</strong></td><td><strong><code>function</code></strong></td><td>Returns the name of the item. If the argument is present, the name is set to the new value.</td></tr><tr><td><strong>create</strong></td><td><strong><code>function</code></strong></td><td>Attaches a <a href="../ui#menugroup"><code>group</code></a> to the current item.</td></tr></tbody></table>
