Skip to main content
Elements you define show up in the ESP builder, where the user places and toggles them. Your evaluate supplies the value for each entity.
evaluate runs once per entity every tick, so keep it cheap. You don’t draw anything yourself: return a value and the builder draws it.

Overview

Classes

esp.class, context.

Elements

text, bar, icon.

Return values

Text and bar shapes.

Element handles

alive, enabled, preview, dispose.

Classes

class


The ESP of one kind of entity. Returns the same object every time for the same kind.
class is a reserved word, so the named import needs a rename: import { class as espClass } from "@native/esp";.

context


Runs once per entity per tick, before the elements. Its result is the ctx every evaluate of the class gets. A throw hides all of the class’s elements on that entity for the tick. Set it to null to remove it.

Elements

Every element takes the same definition object. A throw inside evaluate hides the element on that entity for the tick and is reported through the global error event.

text


A line of text. Return a string or number, a style object, or null to hide it.

bar


A bar. Return the fill as 0..1, a style object, or null to hide it.

icon


Works like text, but always drawn with the "weapon-icons" font: the text is the glyph string.

Return values

Returned keys override the user’s builder settings for that entity and tick. Keys you leave out keep what the user set.

Text style

For text and icon.

Bar style


Element handles

text, bar and icon return an EspElement. Defining the same type and name again replaces the element: the new one keeps the builder slot and the user’s layout, the old handle goes dead. On a dead handle reads return null and writes throw. Everything is removed when the script unloads.

Example

Name, health and armor for enemies, ammo on dropped weapons.