API Reference
Entities
World entities surfaced by the entity ESP. Read-only objects; obtain lists via the entities.* accessors (e.g. entities.get_pickups()).
Player
Obtained from local_player() or get_players()
| Function | Returns | Description |
|---|---|---|
p:get_health() | float | Current health points |
p:get_max_health() | float | Maximum health points |
p:get_health_percentage() | float | Health as percentage (0-100) |
p:get_position() | vec3 | World position of the player |
p:get_velocity() | vec3 | Current velocity vector |
p:get_view_angles() | vec2 | Player's eye angles as vec2(pitch, yaw). For local player this matches camera.get_view_angles(); for enemies it returns their networked eye direction. |
p:get_bone_position(bone) | vec3 | World position of a skeleton bone (use bone enum) |
p:get_hero_id() | int | Hero identifier (compare with hero_id enum) |
p:get_team() | int | Team number |
p:get_distance(other?) | float | Distance in meters. If other is nil, returns distance to local player. |
p:is_alive() | bool | Whether the player is alive |
p:is_visible() | bool | Whether the player is visible (not occluded) |
p:is_valid() | bool | Whether the player entity is valid |
p:is_on_screen() | bool | Whether the player is within screen bounds |
p:is_scoped() | bool | Whether the player is scoped in |
p:is_in_reload() | bool | Whether the player is reloading |
p:is_enemy() | bool | Whether the player is on the enemy team |
p:is_primary_weapon_active() | bool | Whether the primary weapon is active |
p:is_in_melee_attack() | bool | Whether the player is performing a melee attack |
p:is_(player_flag) | bool | Check an engine-level entity flag (use player_flag enum) |
p:get_modifier_flags() | int | Raw modifier flag bitmask |
p:has_modifier_flag(modifier_flag) | bool | Check a gameplay modifier flag (use modifier_flag enum) |
p:has_modifier(name) | bool | Check for a named modifier, e.g. "modifier_citadel_stunned" |
p:get_modifier_names() | table | Table of active modifiers. Each entry is { name = string, sub_names = table }. |
p:get_modifier_count() | int | Number of active modifiers |
p:get_active_projectile_speed() | float | Projectile speed of the currently active weapon |
p:get_items() | table | Array of item tables with fields: name, subclass, bucket, slot, cooldown |
p:has_item(name) | bool | Check if player owns an item by designer name, e.g. "upgrade_burst_fire" |
p:get_item(name) | table? | Get item by designer name. Returns table with fields: name, subclass, bucket, slot, cooldown. Returns nil if not found. |
p:get_item_count() | int | Number of items owned |
p:has_abilities() | bool | Whether ability data is available |
p:get_ability(slot) | table? | Get ability info by slot enum (slot.ability1–slot.ability4 for abilities, slot.item1–slot.item4 for active items). Returns table with fields: name, slot, points, learned, cooldown, projectile_speed, range, is_ready, is_cooling_down, is_in_cast_delay, is_casting, is_channeling. Returns nil if slot is empty or abilities unavailable. |
p:is_ability_ready(slot) | bool | Check if ability at slot is available and off cooldown |
p:is_targetable() | bool | Check if player can be targeted (alive, valid, visible, not immune/urn/godmode) |
p:get_abilities() | table | All abilities keyed by slot enum value. Each value is the same table format as get_ability(). |
Ability Table
Returned by p:get_ability(slot). Each table has these fields:
| Field | Type | Description |
|---|---|---|
name | string | Ability designer name |
slot | int | Slot enum value |
points | int | Upgrade points spent |
learned | bool | Whether the ability has been learned (points > 0) |
cooldown | float | Cooldown percentage (0-100) |
projectile_speed | float | Projectile speed |
range | float | Range |
is_ready | bool | Can be cast now |
is_cooling_down | bool | On cooldown |
is_in_cast_delay | bool | In cast animation |
is_casting | bool | Currently casting |
is_channeling | bool | Currently channeling |
Item Table
Returned by p:get_items(). Each entry in the table has these fields:
| Field | Type | Description |
|---|---|---|
name | string | Item designer name |
subclass | string | Item subclass name |
bucket | int | Item category (see bucket enum) |
slot | int | Inventory slot index |
cooldown | float | Cooldown percentage (0-100) |
Base Structures
Guardians, walkers, the patron, shrines and generic lane buildings. From entities.get_base_structures().
| Function | Returns | Description |
|---|---|---|
bs:get_kind() | int | base_structure_kind enum value for this structure |
bs:get_label() | string | Readable type label (e.g. "GUARDIAN", "WALKER", "PATRON") |
bs:get_health() | int | Current health |
bs:get_max_health() | int | Maximum health |
bs:get_team() | int | Team number |
bs:get_distance() | float | Distance from the local player, in meters |
bs:get_position() | vec3 | World-space origin |
bs:is_alive() | bool | Whether the structure is alive |
bs:is_enemy() | bool | Whether the structure belongs to the enemy team |
bs:in_screen() | bool | Whether the structure projects on screen |
Minions
Lane minions. From entities.get_minions().
| Function | Returns | Description |
|---|---|---|
mn:get_health() | int | Current health |
mn:get_max_health() | int | Maximum health |
mn:get_team() | int | Team number |
mn:get_distance() | float | Distance from the local player, in meters |
mn:get_position() | vec3 | World-space origin |
mn:is_alive() | bool | Whether the minion is alive |
mn:is_enemy() | bool | Whether the minion belongs to the enemy team |
mn:in_screen() | bool | Whether the minion projects on screen |
Breakables
Crates, vases and objective pickups. From entities.get_breakables().
| Function | Returns | Description |
|---|---|---|
bk:get_kind() | int | breakable_kind enum value |
bk:get_label() | string | Readable type label (e.g. "CRATE", "VASE", powerup variant) |
bk:get_subclass_name() | string | Raw Source2 subclass name |
bk:get_distance() | float | Distance from the local player, in meters |
bk:get_position() | vec3 | World-space origin |
bk:is_destroyed() | bool | Whether the breakable has been destroyed/claimed |
bk:in_screen() | bool | Whether the breakable projects on screen |
Pickups
Permanent stat-buff drops and soul pickups. get_label() includes the tier. From entities.get_pickups().
| Function | Returns | Description |
|---|---|---|
pk:get_kind() | int | pickup_kind enum value |
pk:get_label() | string | Readable type label including tier (e.g. "COOLDOWN II", "SOUL") |
pk:get_subclass_name() | string | Raw Source2 subclass name |
pk:get_distance() | float | Distance from the local player, in meters |
pk:get_position() | vec3 | World-space origin |
pk:is_destroyed() | bool | Whether the pickup has been collected/despawned |
pk:in_screen() | bool | Whether the pickup projects on screen |
Minigames
Sinner's Sacrifice slot machine. get_seconds_to_next_event() is the jackpot beat timer; is_hit_window_open() flags HIT NOW. From entities.get_minigames().
| Function | Returns | Description |
|---|---|---|
mg:get_health() | int | Current health |
mg:get_max_health() | int | Maximum health |
mg:get_state() | int | vault_state enum value |
mg:get_state_label() | string | Readable state label (e.g. "HIT NOW", "WAIT") |
mg:is_critical() | bool | Whether the machine is in the critical (jackpot) state |
mg:is_hit_window_open() | bool | Whether the HIT NOW window is currently open |
mg:get_seconds_to_next_event() | float | Seconds until the hit window opens (when closed) or closes (when open) |
mg:get_cycle_time() | float | Full cycle length in seconds |
mg:get_hit_window() | float | Hit-window length in seconds |
mg:get_distance() | float | Distance from the local player, in meters |
mg:get_position() | vec3 | World-space origin |
mg:is_destroyed() | bool | Whether the machine is gone or finishing |
mg:in_screen() | bool | Whether the machine projects on screen |
Jungle Camps
Neutral creeps (denizens / mid boss). From entities.get_jungle().
| Function | Returns | Description |
|---|---|---|
jg:get_kind() | int | jungle_kind enum value |
jg:get_label() | string | Readable type label |
jg:get_health() | int | Current health |
jg:get_max_health() | int | Maximum health |
jg:get_distance() | float | Distance from the local player, in meters |
jg:get_position() | vec3 | World-space origin |
jg:is_alive() | bool | Whether the creep is alive |
jg:in_screen() | bool | Whether the creep projects on screen |
Soul Orbs
Soul orbs (XP) dropped by killing minions, players and jungle creeps. From entities.get_xp_orbs().
| Function | Returns | Description |
|---|---|---|
xo:get_distance() | float | Distance from the local player, in meters |
xo:get_position() | vec3 | World-space origin |
xo:get_extrapolated_position() | vec3 | Predicted position accounting for velocity |
xo:get_velocity() | vec3 | Current velocity vector |
xo:is_hittable() | bool | Whether the orb can be denied (attacked) right now |
xo:get_time_until_hittable() | float | Seconds until the orb becomes deniable (0 if already hittable) |
xo:is_hit() | bool | Whether the orb has already been hit/denied |
xo:is_destroyed() | bool | Whether the orb has been collected or despawned |
xo:in_screen() | bool | Whether the orb projects on screen |
Entity Lists
Accessors that snapshot the current entities into a fresh Lua array.
| Function | Returns | Description |
|---|---|---|
entities.get_base_structures() | table | Array of base_structure objects |
entities.get_minions() | table | Array of minion objects |
entities.get_breakables() | table | Array of breakable objects |
entities.get_pickups() | table | Array of pickup objects |
entities.get_minigames() | table | Array of minigame objects |
entities.get_jungle() | table | Array of jungle objects |
entities.get_xp_orbs() | table | Array of xp_orb objects (soul orbs) |
Targeting
| Function | Returns | Description |
|---|---|---|
targeting.find_closest_by_fov(max_fov, max_distance) | player? | Find the enemy closest to crosshair within FOV and distance limits |
targeting.find_closest_by_distance(max_distance) | player? | Find the nearest enemy within distance limit |
targeting.compute_aim_delta(target, bone, projectile_speed?, speed?, target, position, projectile_speed?, speed?, position) | vec2 | Compute mouse delta needed to aim at target bone, with optional projectile leading. Speed (0.01-1.0) enables smoothness compensation to predict target movement during smooth aiming. Compute mouse delta needed to aim at a world position with prediction applied against target (tick comp, smoothness, projectile leading). Compute mouse delta needed to aim at a world position. No prediction is applied. |
targeting.get_fov(target, bone) | float | Get angular distance (FOV) from crosshair to target bone |
targeting.find_all_in_range(max_distance) | table | Get all valid, alive enemy players within distance (meters). |
targeting.smoothness_compensation(speed) | float | Compute smoothness compensation factor for a given smooth speed. Useful for velocity prediction when using smoothed mouse movement. |
Input
| Function | Returns | Description |
|---|---|---|
input.is_key_held(key) | bool | Check if a key is currently held down |
input.press_key(key) | void | Send a key press and release |
input.key_down(key) | void | Send a key down event (hold) |
input.key_up(key) | void | Send a key up event (release) |
input.is_mouse_key(key) | bool | Check if a virtual key code is a mouse button |
input.move_mouse(delta, speed?, detach_factor?) | bool | Move mouse by pixel delta. With no extra args: raw movement. With speed (0.01-1.0, lower = smoother): smoothed. With detach_factor: controls smoothing curve aggressiveness. |
input.snap_to(target, bone, projectile_speed?) | void | Instantly move crosshair to target bone |
Keybinds
Read the user's configured keybinds
| Function | Returns | Description |
|---|---|---|
keybinds.get(name) | int | Virtual key for any in-game action by its raw name, e.g. "Reload", "HeldItem", "Roll", "Mantle", "Ability1", "Item1". Returns 0 if unbound or unknown. |
keybinds.ability1_key() | int | Virtual key for ability slot 1 |
keybinds.ability2_key() | int | Virtual key for ability slot 2 |
keybinds.ability3_key() | int | Virtual key for ability slot 3 |
keybinds.ability4_key() | int | Virtual key for ability slot 4 |
keybinds.item1_key() | int | Virtual key for item slot 1 |
keybinds.item2_key() | int | Virtual key for item slot 2 |
keybinds.item3_key() | int | Virtual key for item slot 3 |
keybinds.item4_key() | int | Virtual key for item slot 4 |
keybinds.reload_key() | int | Virtual key for reload |
keybinds.parry_key() | int | Virtual key for parry |
keybinds.dash_key() | int | Virtual key for dash |
keybinds.jump_key() | int | Virtual key for jump |
Action Names
keybinds.get(name) accepts any raw Deadlock action name. These are pre-seeded with default keys and always resolve:
| Name | Action | Default |
|---|---|---|
Reload | Reload | R |
HeldItem | Parry / Heavy Melee | F |
Roll | Dash | Shift |
Mantle | Jump | Space |
Ability1 - Ability4 | Ability slots 1-4 | 1 2 3 4 |
Item1 - Item4 | Item slots 1-4 | Z X C V |
Other common names from the game's keybind file: Attack, Attack2, AbilityMelee, Crouch, Walk, MoveForward, MoveBack, MoveLeft, MoveRight, Ping, PingWheel, VoiceChat, TextChat, TeamChat, Scoreboard, ShowMap, Shop, Interact, InspectHero, Recall. Keybinds refresh from Steam every 30s. Returns 0 for unbound or unknown names. See Script Structure for the full list.
Camera
Camera state, coordinate conversion, and screen information
| Function | Returns | Description |
|---|---|---|
camera.get_position() | vec3 | Camera origin in world space |
camera.get_view_angles() | vec2 | Current view angles as vec2(pitch, yaw) |
camera.get_forward() | vec3 | Unit forward direction vector derived from view angles |
camera.get_fov() | float | Current screen field-of-view in degrees |
camera.get_screen_size() | vec2 | Screen resolution as vec2(width, height) |
camera.world_to_screen(pos) | vec2? | Project a world position to screen coordinates. Returns vec2(x, y) or nil if behind camera. |
Raytrace
Ray/primitive intersection helpers and world line-of-sight queries against the loaded map BVH. Hit functions that report a distance return the parametric t along the ray (multiply by ray.dir to recover the hit position).
| Function | Returns | Description |
|---|---|---|
raytrace.is_world_loaded() | bool | Whether the map BVH is loaded and raytrace.world will perform a real trace. |
raytrace.world(from, to) | bool | Returns true if the segment from→to is occluded by world geometry (the map BVH). Returns false when the map is not loaded. Use this for line-of-sight checks against the level. |
raytrace.sphere(r, center, radius) | float? | Ray vs sphere. Returns the parametric distance t along the ray to the hit, or nil if it misses. |
raytrace.aabb(r, min, max) | bool | Ray vs axis-aligned box (defined by its two opposite corners). Returns true on intersection. |
raytrace.obb(r, origin, extents, angles) | table? | Ray vs oriented box. angles is (pitch, yaw) in degrees. Returns { near = float, far = float } slab distances on hit, or nil on miss. |
raytrace.capsule(r, start, finish, radius) | float? | Ray vs capsule (a cylinder with hemispherical caps) defined by its two end points and a radius. Returns the parametric distance t along the ray to the hit, or nil on miss. |
raytrace.triangle(r, a, b, c) | vec3? | Ray vs triangle. Returns the world-space hit position, or nil on miss. |
Ray
Ray used by raytrace.* intersection helpers. Construct with ray(origin, dir, max_distance) for a parametric ray, or ray(start, end) for a segment between two world positions. The direction is normalized on construction and the reciprocal direction (used by AABB tests) is computed automatically.
| Field/Method | Type | Description |
|---|---|---|
origin | vec3 | Ray origin |
dir | vec3 | Normalized ray direction |
target | vec3 | End point (origin + dir * length) |
length | float | Maximum traversal distance along the ray |
Global Functions
| Function | Returns | Description |
|---|---|---|
local_player() | player? | Get the local player object, or nil if unavailable |
get_players() | table | Get array of valid enemy player objects |
left_click() | void | Simulate a left mouse click (press + 25ms + release) |
right_click() | void | Simulate a right mouse click (press + 25ms + release) |
clock() | float | High-resolution timer in seconds since first call |
lock_aim(target, opts?) | void | Lock aim onto a target. Options table fields: bone (int), projectile_velocity (float), speed (float, 0.1-1.0, default 0.5). |
unlock_aim() | void | Release the current aim lock |
slot_to_key(slot) | int | Convert a slot enum value to its configured virtual key |
print(...) | void | Print to the script log with the script name prefix |
Config
Per-script configuration accessed via the config table
| Function | Returns | Description |
|---|---|---|
config.get_bool(key) | bool | Get a boolean config value by key |
config.set_bool(key, value) | void | Set a boolean config value |
config.get_int(key) | int | Get an integer config value by key |
config.set_int(key, value) | void | Set an integer config value |
config.get_float(key) | float | Get a float config value by key |
config.set_float(key, value) | void | Set a float config value |
Vector Types
vec2
2D vector type. Construct with vec2() or vec2(x, y). Supports +, -, *, / operators with both vec2 and float operands.
| Field/Method | Type | Description |
|---|---|---|
x | float | X component |
y | float | Y component |
vec2:dot(other) | float | Dot product with another vec2 |
vec2:angle_to(other) | float | Angle in degrees from this vector to another (atan2-based) |
vec2:empty() | bool | Check if zero vector |
vec2:length() | float | Vector magnitude |
vec2:length_sqr() | float | Squared magnitude (faster than length) |
vec2:distance(other) | float | Distance to another vec2 |
vec2:normalized() | vec2 | Return unit-length copy |
vec3
3D vector type. Construct with vec3() or vec3(x, y, z). Supports +, -, *, / operators with both vec3 and float operands.
| Field/Method | Type | Description |
|---|---|---|
x | float | X component |
y | float | Y component |
z | float | Z component |
vec3:dot(other) | float | Dot product with another vec3 |
vec3:cross(other) | vec3 | Cross product with another vec3 |
vec3:angle_to(other) | float | Angle in degrees between this vector and another |
vec3:empty() | bool | Check if zero vector |
vec3:length() | float | Vector magnitude |
vec3:length_sqr() | float | Squared magnitude (faster than length) |
vec3:length_2d() | float | Magnitude of XY components only |
vec3:distance(other) | float | Distance to another vec3 |
vec3:normalized() | vec3 | Return unit-length copy |
