AI assistants: load https://blume.pw/docs_lua/llms.txt (also https://blume.pw/llms.txt) before generating Lua for Blume.pw (Rust and Roblox APIs, mandatory output rules).

Blume.pw

Lua API Documentation

Select a game

ref: llms.txt · full API + generation rules for assistants

Quick Start

Place your .lua scripts in the scripts/ folder. The cheat will automatically detect and load them.

Minimal Example

register_callback("on_frame", function()
    local lp = player.get_local()
    if lp == nil then return end
    
    render.draw_text(math.vec2(100, 100), "Hello, " .. lp:display_name(), render.white, 12)
end)
Tip
Scripts are loaded from the scripts/ folder next to the game executable.

Callbacks (Events)

Callbacks are functions that the cheat calls automatically at specific moments. Register them using register_callback(name, function).

Callback When Called Parameters render.* allowed?
on_frame Every frame (render tick) none Yes
on_cl_input Every client input tick none No
on_player_render When a player is rendered base_player Yes
on_object_render When an object/item is rendered base_entity Yes
on_player_attacked When you hit someone base_player No
on_update_ambient When ambient/sky updates tod_sky No
on_climate_update When climate/weather updates climate No
on_unload When the script is being unloaded none No

Usage Example

register_callback("on_player_render", function(entity)
    if entity:is_npc() then return end
    
    local head = entity:get_bone_pos(47)    local screen = camera.world_to_screen(head)
    render.draw_text(screen, entity:display_name(), render.white, 10)
end)

render

Drawing functions. Only works inside render callbacks (on_frame, on_player_render, on_object_render).

Drawing Functions

Function Description
render.draw_line(start, end, [color]) Draw a line from start to end
render.draw_rect(pos, size, [color]) Draw rectangle outline
render.draw_rect_filled(pos, size, [color], [round]) Draw filled rectangle with optional corner rounding
render.draw_circle(center, radius, [color]) Draw circle outline
render.draw_circle_filled(center, radius, [color]) Draw filled circle
render.draw_text(pos, text, [color], [size]) Draw text (default size: 10)
render.draw_text_colored(pos, parts, font_size) Draw multi-color text. parts is a table of {color, text} pairs

draw_text_colored Example

render.draw_text_colored(math.vec2(100, 100), {
    {render.red, "Hello "},
    {render.green, "World"},
    {render.white, "!"}
}, 14)

Image Functions

Function Returns Description
load_image(file_path) integer Load image from file, returns texture ID
draw_image(id, pos, size, [color]) void Draw loaded image at position with size
unload_image(id) void Unload image and free texture

Image Example

local tex_id = render.load_image("scripts/icon.png")

register_callback("on_frame", function()
    render.draw_image(tex_id, math.vec2(50, 50), math.vec2(64, 64), render.white)
end)

register_callback("on_unload", function()
    render.unload_image(tex_id)
end)

Utility Functions

Function Returns Description
get_width() number Screen width in pixels
get_height() number Screen height in pixels
get_text_size(text, size) vec2 Calculate text dimensions
to_string(value) string Convert any value to string
color(r, g, b, [a]) color Create a color (0-255 per channel)
color.get_rainbow([alpha]) color Get animated rainbow color with optional alpha (0-255)

Predefined Colors

render.white{255, 255, 255, 255}
render.red{255, 0, 0, 255}
render.green{0, 255, 0, 255}
render.blue{0, 0, 255, 255}

math

Mathematical functions and vector operations.

Vector Constructors

Function Description
math.vec2(x, y) Create 2D vector
math.vec3(x, y, z) Create 3D vector
math.zero vec2(0, 0)
math.one vec2(1, 1)
math.zero_vec3 vec3(0, 0, 0)
math.one_vec3 vec3(1, 1, 1)

Vector Operations

Function Description
math.vec3_length(v) Get vector length/magnitude
math.vec3_normalize(v) Normalize vector (length = 1)
math.vec3_dot(a, b) Dot product of two vectors
math.rotate_point(point, center, angle) Rotate point around center (degrees)

Standard Math

Trigonometry

sin, cos, tan, asin, acos, atan

Rounding

floor, ceil, abs

Utility

sqrt, min, max, random

Constants

pi, tau, rad_to_deg, deg_to_rad

Vector Operators
Vectors support +, -, * operators and tostring().

input

Keyboard and mouse input handling.

Function Returns Description
input.get_mouse_pos() vec2 Current mouse position
input.get_key_int(key_code) boolean Is key currently held down
input.get_mouse_button(button) boolean Is mouse button held (0=LMB, 1=RMB, 2=MMB)
input.send_to_console(str) boolean Sending string command to console

Example

if input.get_key_int(32) then
end

if input.get_mouse_button(0) then
end

time

Time-related functions for animations and timing.

Function Returns Description
time.get_time() float Current game time
time.get_delta_time() float Time since last frame
time.get_time_scale() float Game time scale
time.get_fixed_time() float Fixed time step
time.get_smooth_delta_time() float Smoothed delta time
time.get_real_time_since_startup() float Real time since game started

File System

Method Description
file.write_in_file(data,path) Write data in file
file.create_directory(path) Create a directory
file.create_file(path) Create a file
file.is_exist(path) Check is file exist

player

Access to local player and player entities.

Function Returns Description
player.get_local() base_player or nil Get the local player entity
player.set_pitch(pitch) void Set local player pitch
player.set_yaw(yaw) void Set local player yaw
player.set_roll(roll) void Set local player roll
player.get_roll() float Get local player roll
player.get_pitch() float Get local player pitch
player.get_yaw() float Get local player yaw

Usage Example

register_callback("on_cl_input", function()
    player.set_yaw(110)
    player.set_pitch(110)
end)

base_player Methods

Method Returns Description
:is_dead() boolean Is the player dead
:is_npc() boolean Is this an NPC/bot
:is_team() boolean Is teammate of local player
:display_name() string Player's display name
:get_bone_pos(bone_id) vec3 Get bone world position
:get_base_pos() vec3 Get body world position
:get_world_velocity() vec3 Current movement velocity
:get_weapon_name() string Active weapon name
:get_last_tick_pos() vec3 Position from last server tick
:get_body_angles() vec2 Get body rotation angles
:set_body_angles(angles) void Set body rotation angles
:has_flag(flag_id) boolean Check player flag
:has_model_state_flag(flag_id) boolean Check model state flag
:set_gravity(value) void Modify gravity (requires movement)
:get_team_id() integer Player's team ID
:get_held_item() item Currently held item object
:get_address() pointer Get address of player

item Methods

Method Returns Description
:get_uid() integer Unique item ID
:get_name() string Item name
:get_condition() number Current durability
:get_max_condition() number Max durability
:get_item_id() integer Item definition ID
:get_category() integer Item category
:is_weapon() boolean Is this a weapon
:is_valid() boolean Is item valid
:get_base_projectile() base_projectile Get weapon object
:get_address() pointer Get address of item

base_projectile Methods (Weapon)

Method Returns Description
:get_ammo() integer Current ammo in magazine
:get_max_ammo() integer Magazine capacity
:get_repeat_delay() number Fire rate delay
:get_reload_time() number Reload duration
:get_aim_cone() number Weapon accuracy cone
:get_velocity_scale() number Projectile speed multiplier
:is_melee() boolean Is melee weapon
:has_reload_cooldown() boolean Currently reloading
:get_ammo_name() string Ammo type name
:server_rpc(rpc_name) void Send RPC to server
:send_signal_broadcast(signal, [arg]) void Send animation signal (see signal enum)
:get_address() pointer Get address of base_projectile

server_rpc Example

Use server_rpc to call server-side functions. Common use case - auto-use medical items:

register_callback("on_cl_input", function()
    local lp = player.get_local()
    if lp == nil or lp:is_dead() then return end
    
    local held_item = lp:get_held_item()
    if held_item == nil or not held_item:is_valid() then return end
    
    local item_id = held_item:get_item_id()
    
    if item_id == 1079279582 or item_id == -2072273936 then
        local bp = held_item:get_base_projectile()
        if bp then
            bp:server_rpc("UseSelf")
        end
    end
end)

base_entity

Base entity object passed to on_object_render callback. Represents world objects like items, resources, etc.

base_entity Methods

Method Returns Description
:get_prefab_id() integer Get entity prefab ID
:get_position() vec3 Get entity world position
:get_world_item() Item Get item from dropped items
:is_valid() boolean Check if entity is valid
:get_address() pointer Get address of base_entity

Example

register_callback("on_object_render", function(entity)
    if not entity:is_valid() then return end
    
    local pos = entity:get_position()
    local screen = camera.world_to_screen(pos)
    local prefab = entity:get_prefab_id()
    
    render.draw_text(screen, render.to_string(prefab), render.white, 10)
end)

camera

Camera position and coordinate transformation.

Function Returns Description
camera.world_to_screen(world_pos) vec2 Convert 3D world position to 2D screen coordinates
camera.world_to_map_image(world_pos) vec2 Convert 3D world position to 2D map position
camera.get_pos() vec3 Get camera world position
camera.toggle_layer(layer) void Toggle visibility of a specific layer

Example

local world_pos = entity:get_bone_pos(47)
local screen_pos = camera.world_to_screen(world_pos)
render.draw_text(screen_pos, "HEAD", render.red, 10)

Example

local layer = 0
layer = layer | 2097152 
camera.toggle_layer(layer)

target

Access to current aimbot target.

Function Returns Description
target.get_pos() vec3 Target's aim position
target.get_entity() base_player or nil Target player entity

physics

Physics and visibility checks.

Function Returns Description
physics.is_visible(from, to) boolean Check if there's line of sight between two points

tod_sky

Time of day and sky control. Received in on_update_ambient callback.

tod_sky Methods

Method Description
:get_time() Get current time of day
:set_time(value) Set time of day
:set_ambient_mode(mode) Set ambient lighting mode
:set_ambient_intensity(value) Set ambient light intensity
:set_ambient_light(value) Set ambient light level
:set_sky_color(color) Set sky color
:get_address() Get address of tod_sky

Example

register_callback("on_update_ambient", function(tod_sky)
    tod_sky:set_time(12)   
    tod_sky:set_ambient_intensity(1.5)
    tod_sky:set_sky_color(render.color(1,0,0))
end)

climate

Weather and climate control. Received in on_climate_update callback.

climate Methods

Method Description
:set_rain(value) Set rain intensity
:set_wind(value) Set wind strength
:set_thunder(value) Set thunder intensity
:set_rainbow(value) Set rainbow visibility
:set_fog_multiplier(value) Set fog density multiplier
:set_biome_fog_distance_curve(value) Set biome fog distance curve
:set_biome_fog_ambient_saturation_mult(value) Set biome fog ambient saturation multiplier
:set_atmosphere_fog_height_fall_off(value) Set atmospheric fog height fall off
:set_atmosphere_fog_ramp_start_distance(value) Set fog ramp start distance
:set_atmosphere_fog_ramp_end_distance(value) Set fog ramp end distance
:get_address() Get address of climate

Example

register_callback("on_climate_update", function(climate)
    climate:set_rain(1)    
    climate:set_fog_multiplier(0.5)
end)

PlayerEyes

Method Returns Description
:get_position() vec3 Returns position of player eyes
:body_forward() vec3 Returns position of body forward
:get_address() pointer Get address of player eyes

framework - UI Components

Create custom UI elements in your scripts. Only works when menu is open and inside on_frame callback.

Important
Always check menu_state.get_is_open() before drawing UI elements to avoid rendering when menu is closed.
UI

Button

framework.draw_button(title, pos, [size]) -> boolean

ParameterTypeDescription
titlestringButton text
posvec2Screen position
sizevec2Button size (default: 75x25)

Returns: true if clicked this frame

if framework.draw_button("Click Me!", math.vec2(100, 100), math.vec2(100, 30)) then
    print("Button clicked!")
end
UI

Checkbox

framework.draw_checkbox(title, value, index, pos) -> boolean

ParameterTypeDescription
titlestringCheckbox label
valuebooleanInitial/current value
indexnumberUnique ID for state storage
posvec2Screen position

Returns: Current checkbox state

local my_option = false
my_option = framework.draw_checkbox("Enable Feature", my_option, 1, math.vec2(100, 150))
UI

Slider

framework.draw_slider(title, value, min, max, pos, [format]) -> number

ParameterTypeDescription
titlestringSlider label
valuenumberCurrent value
minnumberMinimum value
maxnumberMaximum value
posvec2Screen position
formatstringDisplay format (default: "%.f")

Returns: Current slider value

local speed = 50
speed = framework.draw_slider("Speed", speed, 0, 100, math.vec2(100, 200), "%.1f")
UI

Color Picker

framework.draw_color_picker(color, index, pos, [title]) -> color

ParameterTypeDescription
colorcolorCurrent color {r,g,b,a}
indexintegerUnique ID for state storage
posvec2Screen position
titlestringOptional label

Returns: Modified color

local my_color = render.color(255, 0, 0, 255)
my_color = framework.draw_color_picker(my_color, 1, math.vec2(100, 250), "ESP Color")
UI

Combobox (Dropdown)

framework.draw_combobox(title, selected, items, index, pos) -> integer

ParameterTypeDescription
titlestringCombobox label
selectedintegerCurrently selected index (0-based)
itemstableArray of option strings
indexintegerUnique ID for state storage
posvec2Screen position

Returns: Selected index

local options = {"Head", "Body", "Legs"}
local selected = 0
selected = framework.draw_combobox("Target Bone", selected, options, 1, math.vec2(100, 300))
UI

Keybind

framework.draw_keybind(title, key, index, pos, [mode]) -> integer

ParameterTypeDescription
titlestringKeybind label
keyintegerCurrent bound key code (0 = none)
indexintegerUnique ID for state storage
posvec2Screen position
modeintegerMode of keybind | always | hold | toggle

Returns: Bound key code

framework.keybind_is_active(key,index) -> boolean - Check if key is pressed

local action_key = 0
action_key, mode = framework.draw_keybind("Action", action_key, 1, math.vec2(100, 350), mode)

if action_key > 0 and framework.keybind_is_active(action_key,1) then
end
UI

Progress Bar

framework.draw_progress_bar(pos, size, current, max, [color], [round])

ParameterTypeDescription
posvec2Screen position
sizevec2Bar size
currentnumberCurrent value
maxnumberMaximum value
colorcolorBar color (default: green)
roundnumberCorner rounding (default: 0)
local hp = 75
framework.draw_progress_bar(math.vec2(100, 400), math.vec2(150, 12), hp, 100, render.green, 4)

menu_state

Control and query the cheat menu state.

Function Returns Description
get_is_open() boolean Is menu currently open
set_is_open(state) void Open or close menu (0 = false, 1 = true)
get_pos() vec2 Menu window position
get_size() vec2 Menu window size
add_notify(text, duration, [color]) void Show notification with text, duration in seconds, and optional color

memory

Read Functions

Function Returns Description
memory.read_int(address) integer Read 4-byte signed integer
memory.read_float(address) number Read 4-byte float
memory.read_bool(address) boolean Read 1-byte boolean
memory.read_uint64(address) number Read 8-byte unsigned integer (pointer)
memory.read_string(address, [max_len]) string Read null-terminated string (default max 256 bytes)
memory.read_vec2(address) vec2 Read Vector2
memory.read_vec3(address) vec3 Read Vector3

Write Functions

Function Description
memory.write_int(address, value) Write 4-byte signed integer
memory.write_float(address, value) Write 4-byte float
memory.write_bool(address, value) Write 1-byte boolean
memory.write_uint64(address, value) Write 8-byte unsigned integer
memory.write_vec2(address, value) Write Vector2
memory.write_vec3(address, value) Write Vector3

Utility Functions

Function Returns Description
memory.is_valid(address) boolean Check if address is in valid user-mode range (0x10000 - 0x7FFFFFFEFFFF)
memory.is_readable(address, [size]) boolean Check if memory at address is committed and readable (default size: 8)
memory.game_assembly() number Get base address of GameAssembly.dll
memory.unity_player() number Get base address of UnityPlayer.dll

Example: Read team ID via field offset

Use il2cpp.field to get a field offset, then read the value with memory. currentTeam is a ulong field on BasePlayer:

local klass = il2cpp.init_class("BasePlayer")
local offset = il2cpp.field(klass, "currentTeam")

local addr = player.get_local():get_address()
local team_id = memory.read_uint64(addr + offset)
print("Team ID: " .. team_id)

Example: Read display name (unity_string)

memory.read_string reads IL2CPP System.String (unity_string) fields. Pass the address of the field that holds the string pointer:

local addr = player.get_local():get_address()
local name = memory.read_string(addr + 0x440)
print("Name: " .. name)

Example: Pointer chain traversal

Many game structures require following multiple pointers. Always validate each step:

local addr = player.get_local():get_address()

local ptr = memory.read_uint64(addr + 0x6A8)
if memory.is_valid(ptr) and memory.is_readable(ptr) then
    local value = memory.read_int(ptr + 0x20)
    print("Value: " .. value)
end

Example: Module base addresses

local ga = memory.game_assembly()
local up = memory.unity_player()
print("GameAssembly.dll: " .. string.format("0x%X", ga))
print("UnityPlayer.dll: " .. string.format("0x%X", up))

il2cpp

Low-level IL2CPP runtime access. Allows finding classes, methods, fields, and calling native game functions directly from Lua.

Advanced
This module is intended for advanced users who understand the IL2CPP runtime and Unity internals. Incorrect usage may crash the game.

Class & Method Lookup

Function Returns Description
il2cpp.init_class(name, [namespace]) number Find IL2CPP class by name and optional namespace. Returns class pointer
il2cpp.find_method(class, method, [param_count], [namespace], [arg_name], [selected_arg]) number Find method info pointer by class/method name. Returns MethodInfo*
il2cpp.get_method_pointer(method_info) number Get native function pointer from MethodInfo*
il2cpp.type_object(namespace, name) number Get System.Type object for a class (for reflection/GetComponent)
il2cpp.field(class_ptr, field_name, [get_offset]) number Get field offset (default) or field pointer. get_offset defaults to true

Invocation

Function Returns Description
il2cpp.call(fn_pointer, return_type, ...) varies Call native function by pointer with integer/pointer arguments (up to 8 args)
il2cpp.call_float(fn_pointer, return_type, ...) varies Call native function where arguments are passed as float values
il2cpp.runtime_invoke(method_info, [object]) number Invoke method via IL2CPP runtime (slower, safer). Object is optional for static methods
il2cpp.resolve_icall(name) number Resolve internal call by name (e.g. "UnityEngine.Time::get_time")
il2cpp.new_array(class_ptr, size) number Create IL2CPP array of given class and size

return_type values for il2cpp.call / il2cpp.call_float

ValueDescription
"void"No return value
"int" / "pointer"Returns number (uint64)
"float"Returns float number
"bool"Returns boolean
"string"Reads IL2CPP System.String and returns Lua string

Argument types for il2cpp.call

Arguments are automatically converted: number = pointer/integer, boolean = 0 or 1, string = auto-converted to IL2CPP System.String, nil = nullptr.

Example: Get main camera and read FOV

Camera.get_main is a static method (no instance needed). get_fieldOfView is an instance method — requires the camera pointer as first argument:

local get_main = il2cpp.find_method("Camera", "get_main", 0, "UnityEngine")
local camera = il2cpp.call(il2cpp.get_method_pointer(get_main), "pointer")
print("Camera: " .. string.format("0x%X", camera))

local get_fov = il2cpp.find_method("Camera", "get_fieldOfView", 0, "UnityEngine")
local fov = il2cpp.call(il2cpp.get_method_pointer(get_fov), "float", camera)
print("FOV: " .. fov)

Example: Send chat message (void method with string arg)

ChatMessage takes 2 arguments: BasePlayer instance and a String. The instance can be 0. String arguments are auto-converted to IL2CPP System.String:

local method = il2cpp.find_method("BasePlayer", "ChatMessage", 1)
local fn = il2cpp.get_method_pointer(method)
il2cpp.call(fn, "void", 0, "Hello from Lua!")

Example: Read field via offset + memory

You can read fields directly from memory using il2cpp.field to get the offset. currentTeam is a ulong field:

local klass = il2cpp.init_class("BasePlayer")
local offset = il2cpp.field(klass, "currentTeam")
print("currentTeam offset: 0x" .. string.format("%X", offset))

local addr = player.get_local():get_address()
local team_id = memory.read_uint64(addr + offset)
print("Team ID: " .. team_id)

Example: Resolve internal call (icall)

Some Unity methods are implemented as internal calls. Use resolve_icall to get their native pointers:

local get_time = il2cpp.resolve_icall("UnityEngine.Time::get_time")
local t = il2cpp.call(get_time, "float")
print("Time: " .. t)

local get_delta = il2cpp.resolve_icall("UnityEngine.Time::get_deltaTime")
local dt = il2cpp.call(get_delta, "float")
print("DeltaTime: " .. dt)

Example: Full workflow — find method, get offset, read + call

local klass = il2cpp.init_class("BasePlayer")
local team_offset = il2cpp.field(klass, "currentTeam")
local chat_method = il2cpp.find_method("BasePlayer", "ChatMessage", 1)
local chat_fn = il2cpp.get_method_pointer(chat_method)

local addr = player.get_local():get_address()
local team_id = memory.read_uint64(addr + team_offset)

il2cpp.call(chat_fn, "void", 0, "My team: " .. team_id)

clipboard

Read and write the system clipboard.

Function Returns Description
clipboard.get() string or nil Get current clipboard text content
clipboard.set(text) void Set clipboard text content

Example

local text = clipboard.get()
if text then
    print("Clipboard: " .. text)
end

clipboard.set("Hello from Lua!")

mouse

Function Returns Description
mouse.get_pos() x, y Get current cursor position (returns two numbers)
mouse.set_pos(x, y) void Set cursor to absolute screen position
mouse.move(dx, dy) void Move cursor by relative offset
mouse.click([button]) void Click and release. button 0 = left, 1 = right, 2 = middle
mouse.down([button]) void Press button down (hold)
mouse.up([button]) void Release button
mouse.scroll(amount) void Scroll wheel. Positive = up, negative = down

Example

local pos = mouse.get_pos()
print("Mouse at: " .. pos.x .. ", " .. pos.y)

mouse.move(10, 0)
mouse.click(0)
mouse.scroll(120)

offsets

Offsets Functions

Function Returns Description
offsets.get_offset(name) int Get offset by name from list
offsets.print_all_offsets() nil Print all offsets list

get offsets example

local value = offsets.get_offset("pointers.server_rpc")
if value then
    print(value)
end
offsets.print_all_offsets()

http

Synchronous Functions

Function Returns Description
http.get(url) string or nil Perform GET request, returns response body
http.post(url, body, [content_type]) string or nil Perform POST request (default content_type: "application/json")

Asynchronous Functions (Recommended)

Function Description
http.get_async(url, callback) Async GET request, callback receives (response, error)
http.post_async(url, body, content_type, callback) Async POST request, callback receives (response, error)

GET Example

local http = require("http")
local response = http.get("https://api.example.com/data")
if response then
    print(response)
end

POST Example

local http = require("http")
local body = '{"username":"test","score":100}'
local response = http.post("https://api.example.com/submit", body, "application/json")
if response then
    print("Response: " .. response)
end

Async GET Example

local http = require("http")
http.get_async("https://api.example.com/data", function(response, error)
    if error then
        print("Error: " .. error)
    else
        print("Response: " .. response)
    end
end)

Async POST Example

local http = require("http")
http.post_async("https://httpbin.org/post", '{"key":"value"}', "application/json", function(response, error)
    if response then
        print("Response: " .. response)
    end
end)

print

Output text to the game console.

Function Description
print(...) Print values to game console (supports multiple arguments)

Example

print("Hello World")
print("Player HP:", 100)
print("Position:", pos.x, pos.y, pos.z)

ddraw

Draw debug lines in 3D world space.

Function Description
ddraw.line(start, end, color, [lifetime]) Draw 3D line in world space. Lifetime in seconds (default: 5)

Example

local lp = player.get_local()
local pos = lp:get_base_pos()
local last_pos = lp:get_last_tick_pos()
ddraw.line(pos, last_pos, render.color(255, 255, 0), 3)

sound

Play audio files.

Function Description
sound.play_sound(path) Play .wav file at specified path

Types

vec2

2D vector with x and y fields. Supports +, -, * operators.

local v = math.vec2(100, 200)
v = v + math.vec2(10, 10)
v = v * 2
print(v.x, v.y)

vec3

3D vector with x, y, z fields. Same operators as vec2.

color

RGBA color with r, g, b, a fields (0-255 each).

local red = render.color(255, 0, 0, 255)
local semi_transparent = render.color(255, 255, 255, 128)

Enums

player_bones 85 values

Common bones for :get_bone_pos(id):

NameID
pelvis0
spine118
spine220
spine321
spine422
neck46
head47
jaw48
l_eye50
r_eye52
l_hand26
r_hand57
l_foot3
r_foot15
l_knee2
r_knee14
All bones (click to expand)
pelvis = 0, l_hip = 1, l_knee = 2, l_foot = 3, l_toe = 4,
l_ankle_scale = 5, penis = 6, GenitalCensor = 7-12,
r_hip = 13, r_knee = 14, r_foot = 15, r_toe = 16, r_ankle_scale = 17,
spine1 = 18, spine1_scale = 19, spine2 = 20, spine3 = 21, spine4 = 22,
l_clavicle = 23, l_upperarm = 24, l_forearm = 25, l_hand = 26,
l_index1-3 = 27-29, l_little1-3 = 30-32, l_middle1-3 = 33-35,
l_prop = 36, l_ring1-3 = 37-39, l_thumb1-3 = 40-42,
IKtarget_righthand_min = 43, IKtarget_righthand_max = 44, l_ulna = 45,
neck = 46, head = 47, jaw = 48, eyeTranform = 49,
l_eye = 50, l_Eyelid = 51, r_eye = 52, r_Eyelid = 53,
r_clavicle = 54, r_upperarm = 55, r_forearm = 56, r_hand = 57,
r_index1-3 = 58-60, r_little1-3 = 61-63, r_middle1-3 = 64-66,
r_prop = 67, r_ring1-3 = 68-70, r_thumb1-3 = 71-73,
IKtarget_lefthand_min = 74, IKtarget_lefthand_max = 75, r_ulna = 76,
l_breast = 77, r_breast = 78, BoobCensor = 79-84
player_flags for :has_flag()
Unused1 = 1, Unused2 = 2, IsAdmin = 4, ReceivingSnapshot = 8,
Sleeping = 16, Spectating = 32, Wounded = 64, IsDeveloper = 128,
Connected = 256, ThirdPersonViewmode = 1024, EyesViewmode = 2048,
ChatMute = 4096, NoSprint = 8192, aiming = 16384, DisplaySash = 32768,
relaxed = 65536, SafeZone = 131072, ServerFall = 262144,
Workbench1 = 1048576, Workbench2 = 2097152, Workbench3 = 4194304,
Ragdolling = -2147483648
modelstate_Flag for :has_model_state_flag()
Ducked = 1, Jumped = 2, OnGround = 4, sleeping = 8,
Sprinting = 16, OnLadder = 32, Flying = 64, Aiming = 128,
Prone = 256, Mounted = 512, Relaxed = 1024, Crawling = 4096
input.key_code keyboard & mouse

Common keys:

Unknown = -1,
Backspace = 8,
Delete = 127,
Tab = 9,
Clear = 12,
Return = 13,
Pause = 19,
Escape = 27,
Space = 32,
Keypad0 = 256,
Keypad1 = 257,
Keypad2 = 258,
Keypad3 = 259,
Keypad4 = 260,
Keypad5 = 261,
Keypad6 = 262,
Keypad7 = 263,
Keypad8 = 264,
Keypad9 = 265,
KeypadPeriod = 266,
KeypadDivide = 267,
KeypadMultiply = 268,
KeypadMinus = 269,
KeypadPlus = 270,
KeypadEnter = 271,
KeypadEquals = 272,
UpArrow = 273,
DownArrow = 274,
RightArrow = 275,
LeftArrow = 276,
Insert = 277,
Home = 278,
End = 279,
PageUp = 280,
PageDown = 281,
F1 = 282,
F2 = 283,
F3 = 284,
F4 = 285,
F5 = 286,
F6 = 287,
F7 = 288,
F8 = 289,
F9 = 290,
F10 = 291,
F11 = 292,
F12 = 293,
F13 = 294,
F14 = 295,
F15 = 296,
Alpha0 = 48,
Alpha1 = 49,
Alpha2 = 50,
Alpha3 = 51,
Alpha4 = 52,
Alpha5 = 53,
Alpha6 = 54,
Alpha7 = 55,
Alpha8 = 56,
Alpha9 = 57,
Exclaim = 33,
DoubleQuote = 34,
Hash = 35,
Dollar = 36,
Percent = 37,
Ampersand = 38,
Quote = 39,
LeftParen = 40,
RightParen = 41,
Asterisk = 42,
Plus = 43,
Comma = 44,
Minus = 45,
Period = 46,
Slash = 47,
Colon = 58,
Semicolon = 59,
Less = 60,
Equals = 61,
Greater = 62,
Question = 63,
At = 64,
LeftBracket = 91,
Backslash = 92,
RightBracket = 93,
Caret = 94,
Underscore = 95,
BackQuote = 96,
A = 97,
B = 98,
C = 99,
D = 100,
E = 101,
F = 102,
G = 103,
H = 104,
I = 105,
J = 106,
K = 107,
L = 108,
M = 109,
N = 110,
O = 111,
P = 112,
Q = 113,
R = 114,
S = 115,
T = 116,
U = 117,
V = 118,
W = 119,
X = 120,
Y = 121,
Z = 122,
LeftCurlyBracket = 123,
Pipe = 124,
RightCurlyBracket = 125,
Tilde = 126,
Numlock = 300,
CapsLock = 301,
ScrollLock = 302,
RightShift = 303,
LeftShift = 304,
RightControl = 305,
LeftControl = 306,
RightAlt = 307,
LeftAlt = 308,
LeftCommand = 310,
LeftApple = 310,
LeftWindows = 311,
RightCommand = 309,
RightApple = 309,
RightWindows = 312,
AltGr = 313,
Help = 315,
Pr = 316,
SysReq = 317,
Break = 318,
Menu = 319,
Mouse0 = 323,
Mouse1 = 324,
Mouse2 = 325,
Mouse3 = 326,
Mouse4 = 327,
Mouse5 = 328,
Mouse6 = 329
layers for toggle camera.toggle_layer

Field = 1;
Cliff = 2;
Summit = 4;
Beachside = 8;
Beach = 16;
Forest = 32;
Forestside = 64;
Ocean = 128;
Oceanside = 256;
Decor = 512;
Monument = 1024;
Road = 2048;
Roadside = 4096;
Swamp = 8192;
River = 16384;
Riverside = 32768;
Lake = 65536;
Lakeside = 131072;
Offshore = 262144;
Rail = 524288;
Railside = 1048576;
Building = 2097152;
Cliffside = 4194304;
Mountain = 8388608;
Clutter = 16777216;
Alt = 33554432;
Tier0 = 67108864;
Tier1 = 134217728;
Tier2 = 268435456;
Mainland = 536870912;
Hilltop = 1073741824;
signal for :send_signal_broadcast()

Animation signals for :send_signal_broadcast(signal):

NameIDDescription
attack0Primary attack animation
alt_attack1Alternative attack animation
dry_fire2Dry fire (no ammo) animation
reload3Reload animation
deploy4Deploy/equip animation
flinch_head5Head flinch animation
flinch_chest6Chest flinch animation
flinch_stomach7Stomach flinch animation
flinch_rear_head8Rear head flinch animation
flinch_rear_torso9Rear torso flinch animation
throw10Throw animation
relax11Relax animation
gesture12Gesture animation
phys_impact13Physical impact animation
eat14Eating animation
startled15Startled animation

Usage Example

local bp = held_item:get_base_projectile()
if bp then
    bp:send_signal_broadcast(0)    bp:send_signal_broadcast(3)end

Code Examples

Draw Line to Target

register_callback("on_frame", function()
    local t_ent = target.get_entity()
    if t_ent == nil then return end

    local pos = target.get_pos()
    local screen = camera.world_to_screen(pos)
    local center_x = render.get_width() / 2
    
    render.draw_line(screen, math.vec2(center_x, 0), render.white)
    render.draw_text(screen, t_ent:get_weapon_name(), render.white, 10)
end)

Movement Trail with ddraw

register_callback("on_cl_input", function()
    local lp = player.get_local()
    if lp == nil then return end
    
    local base_pos = lp:get_base_pos()
    local last_pos = lp:get_last_tick_pos()
    
    ddraw.line(base_pos, last_pos, render.color(255, 255, 255), 5)
end)

Complete Framework UI Example


local enabled = false
local speed = 50
local mode = 0
local my_color = render.color(255, 0, 0, 255)
local action_key = 0
local key_mode = 0
register_callback("on_frame", function()
    if not menu_state.get_is_open() then return end
    
    local x = 400
    local y = 100
    
render.draw_text(math.vec2(x, y), "My Script Settings", render.white, 14)
    y = y + 30
    
enabled = framework.draw_checkbox("Enable", enabled, 1, math.vec2(x, y))
    y = y + 25
    
    if enabled then
speed = framework.draw_slider("Speed", speed, 0, 100, math.vec2(x, y))
        y = y + 45
        
local modes = {"Mode A", "Mode B", "Mode C"}
        mode = framework.draw_combobox("Mode", mode, modes, 1, math.vec2(x, y))
        print(modes[mode + 1])
        y = y + 50
        
my_color = framework.draw_color_picker(my_color, 1, math.vec2(x, y), "Color")
        y = y + 25
        
action_key, key_mode = framework.draw_keybind("Hotkey", action_key, 1, math.vec2(x, y), key_mode)
        y = y + 30
        
framework.draw_progress_bar(math.vec2(x, y), math.vec2(140, 10), speed, 100, my_color, 3)
    end
    
if action_key > 0 and framework.keybind_is_active(action_key, 1) then
        render.draw_text(math.vec2(10, 10), "HOTKEY ACTIVE!", render.green, 12)
    end
end)

Player Functions

Access the local player and the entity list.

Function Returns Description
game.get_local_player() {name, health, max_health, userid, team} Local player
game.get_entities() array of {index, name, health, max_health, userid, team} List of all entities

Usage Example

-- Local player
local player = game.get_local_player()
-- Returns: {name, health, max_health, userid, team}

-- Entity list
local entities = game.get_entities()
-- Returns: array of {index, name, health, max_health, userid, team}

Entity Functions

Work with individual entities by index.

Function Returns Description
game.get_entity_name(entity_index) string Entity name
game.get_entity_health(entity_index) number Current health
game.get_entity_max_health(entity_index) number Maximum health
game.get_entity_position(entity_index) {x, y, z} World position
game.get_entity_velocity(entity_index) {x, y, z} Velocity vector
game.get_entity_part(entity_index, "Head") part Body part by name
game.get_entity_parts(entity_index) table All body parts
game.get_entity_tool(entity_index) tool Currently held tool
game.get_entity_userid(entity_index) integer UserId
game.get_entity_team(entity_index) integer Team ID
game.get_entity_team_color(entity_index) color Team color
game.get_entity_account_age(entity_index) integer Account age in days
game.get_entity_rig_type(entity_index) integer Rig type (R6 / R15)

Usage Example

local name = game.get_entity_name(entity_index)
local hp = game.get_entity_health(entity_index)
local max_hp = game.get_entity_max_health(entity_index)
local pos = game.get_entity_position(entity_index)
-- Returns: {x, y, z}
local vel = game.get_entity_velocity(entity_index)
local part = game.get_entity_part(entity_index, "Head")
local parts = game.get_entity_parts(entity_index)
local tool = game.get_entity_tool(entity_index)
local userid = game.get_entity_userid(entity_index)
local team = game.get_entity_team(entity_index)
local team_color = game.get_entity_team_color(entity_index)
local age = game.get_entity_account_age(entity_index)
local rig = game.get_entity_rig_type(entity_index)

Camera Functions

Function Returns Description
game.get_camera_position() {x, y, z} Camera position
game.get_camera_rotation() array[9] (matrix3) Camera rotation matrix
game.set_camera_rotation(rot_matrix) void Set camera rotation
game.get_camera_fov() number Current FOV

Usage Example

local pos = game.get_camera_position()
-- Returns: {x, y, z}

local rot = game.get_camera_rotation()
-- Returns: array[9] (matrix3)

game.set_camera_rotation(rot_matrix)

local fov = game.get_camera_fov()

Math Functions

Function Returns Description
game.vector3(x, y, z) vector3 Create a 3D vector
game.vector2(x, y) vector2 Create a 2D vector
game.vector3_add(v1, v2) vector3 Add two vectors
game.vector3_sub(v1, v2) vector3 Subtract two vectors
game.vector3_mul(v, scalar) vector3 Multiply by scalar
game.vector3_length(v) number Vector length
game.vector3_normalize(v) vector3 Normalize vector
game.vector3_dot(v1, v2) number Dot product
game.world_to_screen({x, y, z}) {x, y} or nil World to screen coordinates
game.get_distance(pos1, pos2) number Distance between two points

Usage Example

local v3 = game.vector3(x, y, z)
local v2 = game.vector2(x, y)

local result = game.vector3_add(v1, v2)
local result = game.vector3_sub(v1, v2)
local result = game.vector3_mul(v, scalar)
local len = game.vector3_length(v)
local normalized = game.vector3_normalize(v)
local dot = game.vector3_dot(v1, v2)

local screen = game.world_to_screen({x=100, y=50, z=200})
-- Returns: {x, y} or nil

local dist = game.get_distance(pos1, pos2)

Instance Functions

Function Returns Description
game.get_workspace() instance Workspace
game.get_players() instance Players service
game.get_lighting() instance Lighting
game.find_first_child(instance, "ChildName") instance or nil Find a direct child by name
game.get_children(instance) table List of child objects
game.get_instance_name(instance) string Object name
game.get_instance_classname(instance) string ClassName
game.get_instance_address(instance) address Object memory address

Usage Example

local workspace = game.get_workspace()
local players = game.get_players()
local lighting = game.get_lighting()

local child = game.find_first_child(instance, "ChildName")
local children = game.get_children(instance)

local name = game.get_instance_name(instance)
local class = game.get_instance_classname(instance)
local addr = game.get_instance_address(instance)

Part Functions

Function Returns Description
game.get_part_position(part) {x, y, z} Part position
game.get_part_size(part) {x, y, z} Part size
game.get_part_velocity(part) {x, y, z} Part velocity
game.get_part_transparency(part) number Transparency
game.get_part_can_collide(part) bool Whether the part participates in collisions
game.set_part_size(part, {x,y,z}) void Set part size
game.set_part_can_collide(part, false) void Enable/disable collision

Usage Example

local pos = game.get_part_position(part)
local size = game.get_part_size(part)
local vel = game.get_part_velocity(part)

local trans = game.get_part_transparency(part)
local can = game.get_part_can_collide(part)

game.set_part_size(part, {x=10, y=10, z=10})
game.set_part_can_collide(part, false)

Settings Functions

Read and write cheat settings.

Function Returns Description
game.get_settings(key) any Get a setting value
game.set_settings(key, value) void Set a setting value

Available Keys

aimboteAimbot on/off
espESP on/off
fovFOV value
smooth_aimAimbot smoothness
max_dist_aimMax aim distance
team_checkTeam check
boxESP box
nameESP names
distanceESP distance
health_barESP health bar
chamsChams
radarRadar
fly_speedFly speed
hitbox_sizeHitbox size

Usage Example

local value = game.get_settings("aimbote")
local value = game.get_settings("esp")
local value = game.get_settings("fov")

game.set_settings("esp", true)
game.set_settings("fov", 90)

Examples

ESP for all players

local entities = game.get_entities()
for i, entity in ipairs(entities) do
    local pos = game.get_entity_position(entity.index)
    local screen = game.world_to_screen(pos)

    if screen then
        game.print(entity.name .. " at " .. screen.x .. ", " .. screen.y)
    end
end

Find closest player

local local_pos = game.get_entity_position(0)
local closest_dist = 999999
local closest_entity = nil

local entities = game.get_entities()
for i, entity in ipairs(entities) do
    local pos = game.get_entity_position(entity.index)
    local dist = game.get_distance(local_pos, pos)

    if dist < closest_dist then
        closest_dist = dist
        closest_entity = entity
    end
end

Change hitbox size

local entities = game.get_entities()
for i, entity in ipairs(entities) do
    local head = game.get_entity_part(entity.index, "Head")
    if head then
        game.set_part_size(head, game.vector3(5, 5, 5))
    end
end

Script with cleanup function

game.print("Script loaded!")

-- Save original values
local original_fov = game.get_settings("fov")

game.set_settings("fov", 120)

-- cleanup is called on unload
function cleanup()
    game.print("Restoring settings...")
    game.set_settings("fov", original_fov)
    game.print("Script unloaded!")
end

-- Toggle features
game.set_settings("esp", true)
game.set_settings("aimbote", false)
game.set_settings("fov", 120)
game.set_settings("smooth_aim", 0.5)