Lua VM API Reference
High-performance external Lua 5.4 scripting environment featuring low-level virtual memory read/write inspection, dynamic offset resolution, native DirectX 11 overlay rendering, complete Dear ImGui windowing, custom styling, entity radar collection, and universal executor primitives.
Find Scripts from Script Hub
Online Repository · 1-Click Selyn SyncBrowse verified and community Lua scripts for Rivals, Arsenal, Blox Fruits, and more. Click "Open in Selyn" on any script to load it directly into your client.
Full Lua VM Reference
Memory Engine · DirectX Draw · ImGuiRead comprehensive technical documentation on reading/writing memory, building custom GUI menus, drawing 3D world projections, radar entity loops, and executing external scripts.
Virtual Memory Read Operations
Low-level memory introspection utilities with support for primitive datatypes, 64-bit pointers, strings, vectors, and camera matrices. Available under both the memory.* table and global aliases.
Returns the 64-bit base module address of the target process executable.
local base_addr = memory.get_base()
print(string.format("[Memory] Target base address: 0x%X", base_addr))
Reads an unsigned 8-bit byte integer (0–255) from the specified virtual memory address.
Reads a signed 16-bit short integer from virtual memory.
Reads a signed 32-bit integer from the specified virtual address.
Reads a 64-bit unsigned pointer address from memory.
local data_model = memory.read_uint64(base_addr + offsets.datamodel)
Reads a single-precision 32-bit floating point value from memory (e.g., WalkSpeed, JumpPower, Health).
Reads a double-precision 64-bit float from memory.
Reads a null-terminated ASCII string or internal string buffer from memory.
Reads three consecutive 32-bit floats and returns a native Selyn Vector3 structure with X, Y, Z coordinates.
Reads two consecutive 32-bit floats and returns a Vector2 structure.
Virtual Memory Write Operations
Direct virtual memory modification operations. Write operations require "Allow Unrestricted VM Operations" enabled in Selyn settings.
Writes an 8-bit unsigned integer (byte) to the specified virtual address.
Writes a 16-bit short integer to memory.
Writes a 32-bit signed integer to memory.
Writes a 64-bit pointer / integer address into memory.
Writes a 32-bit floating point value to memory.
Writes a 64-bit double-precision float to memory.
Writes an ASCII string buffer with null-termination to the target address.
Writes three 32-bit floats (X, Y, Z) to virtual memory. Accepts either three numeric arguments or a single Vector3 / table structure.
memory.write_vector3(pos_addr, 100.5, 45.0, -230.2) -- or using Vector3 object: memory.write_vector3(pos_addr, Vector3.new(100.5, 45.0, -230.2))
Writes two 32-bit floats (X, Y) to virtual memory.
Memory Scanning
Search Roblox's heap (committed, private, read/write memory) for a value instead of reading a known address. Both functions need Allow Unsafe Lua turned on, and return an empty table when it is off. A full scan reads the whole heap, so it takes a moment: call them once and keep the results, not every frame.
Returns the addresses where text is stored followed by a zero byte (how strings sit in memory), up to max results. text can be 1 to 200 bytes long.
local hits = memory.find_string("rbxassetid://13087362838", 16)
for _, addr in ipairs(hits) do
print(string.format("found at 0x%X", addr))
end
Returns the 8-byte-aligned addresses that hold the 64-bit value, up to max results. Use it to find what points at an address, for example every table slot that references a string you found with find_string.
local target = 0x2DC23D26CC0 -- an object's address
for _, slot in ipairs(memory.find_qword(target, 64)) do
print(string.format("referenced from 0x%X", slot))
end
Dynamic Offsets Engine
Access calibrated game offsets mapped automatically by Selyn's pattern scanner. Offsets can be read directly via the offsets.* table or queried through selyn.get_offset().
Direct offset lookup table. Case-insensitive and supports camelCase, snake_case, and PascalCase keys.
- offsets.datamodel: Pointer offset to DataModel root instance.
- offsets.visualengine: VisualEngine rendering viewport offset.
- offsets.viewmatrix: 4x4 ViewMatrix transformation matrix offset.
- offsets.player_list: Offset to player list container array.
- offsets.localplayer: Offset to the LocalPlayer instance.
- offsets.name / offsets.character: Offsets to entity name and character model.
- offsets.rootpart / offsets.humanoid: Offsets to HumanoidRootPart and Humanoid instances.
- offsets.health / offsets.max_health: Offsets to entity health values.
- offsets.camera_pos / offsets.camera_cframe: Offsets to active camera coordinates.
local dm_ptr = memory.read_uint64(memory.get_base() + offsets.datamodel)
Returns the numerical offset value for the specified offset identifier name.
Returns a table containing all active offset name-value pairs.
Embedded Script Hub UI System
Create custom GUI tabs and settings widgets that embed directly inside Selyn's main window under the dedicated "Script UI" header tab.
Registers a dedicated script sub-tab that automatically appears inside Selyn's menu under the Script UI header navigation. All ImGui controls (checkboxes, sliders, color pickers, buttons) rendered inside the callback adopt Selyn's glassmorphic styling and active color theme.
local esp_enabled = true
local esp_color = { 0.2, 0.6, 1.0, 1.0 }
local max_dist = 500.0
imgui.createtab("Auto ESP + Farm", function()
imgui.text_colored(0.4, 0.8, 1.0, 1.0, "Script Configuration")
imgui.separator()
esp_enabled = imgui.checkbox("Enable Target ESP", esp_enabled)
esp_color = imgui.color_picker("ESP Color", esp_color)
max_dist = imgui.slider_float("Max Distance", max_dist, 50.0, 2000.0)
if imgui.button("Clear Cache", 160, 30) then
print("[Script] Cache cleared!")
end
end)
Windowing & Panel Construction
Create floating panels, glassmorphic cards, HUDs, or full menus with configurable window flags and coordinate positioning.
Begins an independent ImGui window. Supports window flags, open states, and table configuration.
if imgui.begin("Custom Overlay Window", { no_title = true, no_bg = true }) then
imgui.text("Frameless transparent window")
imgui.end()
end
Closes the active ImGui window scope. Automatically restores any base styling pushed by the window.
Sets the position of the next window to be created. Default condition is ImGuiCond_Once (4).
Sets the dimensions of the next window to be created.
Overrides the background opacity (0.0 to 1.0) of the upcoming window.
Returns the current position and size of the active window.
Available flags: None, NoTitleBar, NoResize, NoMove, NoScrollbar, NoCollapse, AlwaysAutoResize, NoBackground, NoSavedSettings, NoMouseInputs, MenuBar.
Custom Styling, Colors & Themes
Fine-tune corner rounding, item padding, alpha blending, and custom color accents.
Pushes a temporary RGBA color override onto the style stack for the specified element type.
imgui.push_style_color(imgui.col.Button, 0.15, 0.15, 0.22, 0.9)
imgui.push_style_color(imgui.col.ButtonHovered, 0.35, 0.45, 0.95, 1.0)
imgui.button("Stylized Accent Button", 200, 32)
imgui.pop_style_color(2)
Pops one or more style color overrides from the style stack.
Pushes a style numeric or vector variable (e.g., FrameRounding, WindowPadding, ItemSpacing).
Color indices: Text, WindowBg, ChildBg, PopupBg, Border, FrameBg, FrameBgHovered, FrameBgActive, TitleBg, TitleBgActive, CheckMark, SliderGrab, SliderGrabActive, Button, ButtonHovered, ButtonActive, Header, HeaderHovered, HeaderActive, Separator, Tab, TabHovered, TabActive.
Interactive Widgets & Form Controls
Native controls for building rich interactive script configurations.
Renders an interactive checkbox. Returns new_state, clicked.
aimbot_enabled = imgui.checkbox("Enable Silent Aim", aimbot_enabled)
Renders a checkbox integrated with a color picker square on the right side.
Renders a smooth float slider bar. Returns new_value, changed.
Renders an integer slider bar.
Renders a dropdown selection combo box.
local target_parts = { "Head", "HumanoidRootPart", "Torso" }
local selected_part = 0
selected_part = imgui.combo("Target Hitbox", selected_part, target_parts)
Renders an RGBA color picker widget. Accepts and returns { r, g, b, [a] } normalized 0.0 to 1.0.
Renders an interactive keybind selector box (Click + press any key to bind).
Renders a clickable push button. Returns true on click.
Single-line text input field.
Multi-line code/text editor input area.
Renders plain or formatted colored text.
Draws stylized pill badges or native UI glyph icons.
Tabs, Layout Groups & Child Windows
Organize controls into grouped cards, scrollable sub-frames, and multi-tab pages.
Creates an embedded sub-window frame with independent scrolling and clipping.
Closes the active child window frame.
Locks bounding coordinates of child items into a single logical group for multi-column layouts.
Positions the subsequent item horizontally on the same line as the previous item.
Draws a subtle horizontal divider line or adds vertical spacing.
DirectX 11 Drawing.new OOP Pipeline
Universal standard Drawing library compatible with standard executor scripts. Objects automatically render on top of the screen each frame.
Constructs a new persistent Drawing primitive. Supported types: "Line", "Square", "Circle", "Text", "Triangle", "Quad".
- .Visible: (boolean) Controls rendering visibility.
- .Color: (Color3) Render color structure (Color3.new or Color3.fromRGB).
- .Transparency: (number) Alpha transparency (0.0 to 1.0).
- .Thickness: (number) Border or line stroke thickness in pixels.
- .Filled: (boolean) For Square, Circle, Triangle, Quad: filled interior.
- .From / .To: (Vector2) For Line: start and end screen coordinates.
- .Position / .Size: (Vector2) For Square and Text: screen position and dimensions.
- .Radius / .NumSides: (number) For Circle: radius and polygon segments.
- .PointA / .PointB / .PointC / .PointD: (Vector2) For Triangle and Quad: vertex coordinates.
- .Text / .Center / .Outline / .OutlineColor: For Text: string content, centering, and border outline.
- :Remove() / :Destroy(): Deletes the drawing object and releases GPU resources.
local box = Drawing.new("Square")
box.Visible = true
box.Color = Color3.fromRGB(0, 255, 120)
box.Thickness = 1.5
box.Filled = false
box.Position = Vector2.new(500, 300)
box.Size = Vector2.new(120, 180)
Utility functions to clear all active drawing objects or test if a table is a valid Drawing instance.
DirectX 11 Immediate Draw Pipeline
Immediate-mode rendering primitives for custom ESP, crosshairs, tracers, and radar overlays. Used inside callbacks:register("paint", fn) or on_paint(fn).
Renders crisp text on the DirectX 11 overlay at (x, y).
Draws an anti-aliased line between two screen pixel coordinates.
Draws an outlined or filled rectangle.
Draws a rectangle with smooth rounded corners.
Draws a 4-point color interpolated gradient rectangle.
Draws an outlined or filled circle.
Draws a 3-point polygon triangle.
Camera & 3D World-to-Screen Projection
Hardware-accelerated mathematical projection from 3D world space coordinates to 2D screen pixels.
Projects a 3D world coordinate (X, Y, Z) using the active ViewMatrix into 2D viewport coordinates. Returns screen_x, screen_y, on_screen.
local sx, sy, on_screen = camera.world_to_screen(head_x, head_y, head_z)
if on_screen then
draw.circle(sx, sy, 4.0, 1.0, 0.2, 0.2, 1.0)
end
Returns the 3D position (X, Y, Z) of the local camera in world space.
Returns the normalized direction vector (X, Y, Z) the camera is currently facing.
Returns width and height of the rendering viewport.
Smoothly rotates the camera view angle towards target world coordinates.
Queries desktop and game client window resolution dimensions and center point coordinates.
Instance OOP Hierarchy & Reflection
Interact with game instances using standard object-oriented Roblox methods.
Finds a child instance matching the given name or returns nil.
local char = localplayer:FindFirstChild("Character")
if char then
local hrp = char:FindFirstChild("HumanoidRootPart")
end
Finds a child instance of the specified ClassName.
Returns an array table containing all child instances.
Recursively returns all descendant instances in the hierarchy tree.
Tests if the instance inherits from or matches the specified ClassName.
Direct field access and helper methods on instance objects.
Game Reflection & Services
Global access to game services, players, and runtime events.
Returns service instances (e.g., game:GetService("Players"), game:GetService("Workspace"), game:GetService("RunService")).
Global reference to the Workspace instance and active Camera.
Connects callbacks to the frame rendering and physics tick event loop.
Standard service helpers for keyboard and mouse input querying.
Entities, Players & Radar Containers
Direct high-speed entity iteration from Selyn's cached memory pipeline.
Returns a table of all active player objects populated from memory with fields: name, address, pos_x, pos_y, pos_z, health, max_health, team, is_alive.
for i, ply in ipairs(entities.get_players()) do
if ply.is_alive then
local sx, sy, on_screen = camera.world_to_screen(ply.pos_x, ply.pos_y, ply.pos_z)
if on_screen then
draw.text(sx, sy, ply.name, 1.0, 1.0, 1.0, 1.0)
end
end
end
Returns the LocalPlayer entity table.
Registers a custom instance folder in memory to be automatically indexed by Selyn's multi-threaded entity pipeline.
Returns all active entities within a custom registered container.
Event Callbacks & Frame Hooks
Register hooks executed automatically by the rendering and update loops.
Registers a per-frame DirectX 11 rendering callback.
callbacks.paint(function()
draw.text(20, 20, "Selyn Lua VM Active", 0.4, 1.0, 0.5, 1.0)
end)
Registers a background update tick callback executed independent of overlay frame rate.
Universal Executor & Environment APIs
Standard executor APIs for environment manipulation, metatable hooking, and runtime inspection.
Returns the global shared execution environment table.
Retrieves or overrides the metatable of an object bypassing readonly protections.
Toggles the readonly state flag on a table.
Hooks a Lua function or metamethod with a custom replacement and returns the original trampoline.
Wraps a Lua closure to simulate a C function.
Returns caller authentication and identifies the executor as ("Selyn", "1.5").
Math, Types, Filesystem & Globals
Datatype constructors, mathematical utilities, filesystem I/O operations, and runtime globals.
Direct filesystem I/O in the Selyn workspace directory.
if not isfile("config.json") then
writefile("config.json", '{"fov": 90, "speed": 16}')
end
local saved = readfile("config.json")
Folder and file lifecycle management operations.
Dispatches colored log messages and alerts directly into Selyn's built-in Lua Console view.
Constructs standard mathematical vector and color structures with full arithmetic operator support.
Coordinate frame matrix and geometric ray constructors.
Global numeric utility helpers.
Timing primitives, asynchronous task scheduling, and high-precision execution pauses.
Input Simulation & Hardware State
Query physical keystrokes and dispatch synthetic cursor operations.
Queries asynchronous physical key state. Accepts virtual key codes or strings ("SHIFT", "CTRL", "ALT", "SPACE", "LBUTTON", "RBUTTON", "MBUTTON", "X", etc.).
Returns desktop cursor X and Y pixel coordinates.
Performs relative mouse delta movement via native mouse_event.
Sets absolute desktop cursor pixel coordinates.
Smoothly pans the mouse cursor towards target screen coordinates using configurable interpolation.
Dispatches mouse button click, press down, and release up events (1: Left, 2: Right).
Simulates vertical mouse wheel rotation delta (positive = forward/up, negative = backward/down).
Sets or reads text data from the Windows system clipboard.
Local Key-Value Storage
Persistent local storage system for saving script profiles, keys, and configurations across game sessions.
Sets or retrieves values in the local script storage map.
storage.set("aimbot_fov", 120.0)
local fov = storage.get("aimbot_fov", 90.0)
Flushes storage changes to disk, reloads saved values, clears the map, or dumps all key-value entries as a Lua table.
Selyn Client Controls
Control Selyn client notifications, sound effects, and client version queries.
Triggers an animated glassmorphic toast notification in Selyn's notification manager.
selyn.notify("Lua Engine", "Aimbot script loaded successfully!", 3000, { 0.2, 0.8, 1.0, 1.0 })
Plays an audio feedback cue from Selyn's built-in sound effects.
Queries Selyn version string or sets the overlay maximum frame rate cap.
Security Sandboxing & HTTP Primitives
Network requests and dynamic compilation are guarded by Selyn's security policy.
Performs a synchronous native HTTPS GET request using WinHttp and returns the response body string.
local script_code = game:HttpGet("https://raw.githubusercontent.com/.../script.lua")
loadstring(script_code)()
Compiles dynamic Lua bytecode at runtime into executable function chunks.
http.get, memory.write_*, or loadstring, enable "Allow Unrestricted VM Operations" in Selyn Settings.