Start from a project made with
spd new (see Getting started) and keep spd watch
running. The script reloads on every save, so each step shows up in game right away.Step 1: Health text
esp elements live in the user’s ESP builder. The user places and toggles them; your code only supplies the value. Replacesrc/index.ts with:
evaluate runs every tick for every enemy pawn. Returning null hides the element on that pawn.
Open the ESP builder: “health” is there, showing the preview text.
Step 2: Health bar
A bar takes a fraction, or an object when you want to set the colors. Add:colorMode: "value" blends from color when empty to colorAlt when full. Keys you leave out
keep whatever the user set in the builder.
Step 3: Boxes on the overlay
Builder elements are laid out for you. For free-form drawing, use render. Reading entities goes intick, drawing in render: draw calls throw anywhere else.
Add the imports at the top and the listeners at the bottom:
render.boundsOf returns the pawn’s box on screen, or null when part
of it is behind the camera.
Step 4: Head dot and visibility
Store whether each enemy is visible, and pick the color from it. Replace both listeners:isVisible returns null without a map, hence the === true. render.worldToScreen returns null
for points behind the camera.
Step 5: Menu toggle
Give the script a page in the menu with a switch and two colors. Values persist in the user’s configs. Declare controls once, at the top level:Full script
src/index.ts
src/index.ts
Next steps
esp
Icons, style keys,
context, element handles.render
Every draw call, text, textures.
ui
Sliders, combos, hotkeys, reactive labels.
entities
Bones, hitboxes, schema fields.