Lua VM Docs
Complete API reference for the Onyx Lua VM — a Lua 5.1 execution environment that runs externally, bridging into Roblox through memory reads. No injection, no internal hooks, fully external.
Overview
The Onyx Lua VM is a standalone Lua 5.1 interpreter compiled into OnyxCore. It reads Roblox process memory externally to emulate the Roblox Lua API — game services, instances, properties, datatypes — without ever injecting code into the target process.
Scripts execute inside OnyxCore's own process space. Instance access, property reads, and service lookups all happen through external RPM calls. This means the VM leaves zero traces inside the Roblox process.
How It Works
When you execute a script through the Onyx UI, it gets compiled and run inside the embedded Lua 5.1 state. The VM provides 160+ registered globals that mirror the standard Roblox scripting API. Instance objects returned by the VM are proxy tables backed by live memory addresses — accessing a property triggers an external memory read from the Roblox process at the correct struct offset.
-- This reads Roblox memory externally, no injection local players = game:GetService("Players") for _, p in ipairs(players:GetPlayers()) do local char = p.Character if char then local hrp = char:FindFirstChild("HumanoidRootPart") if hrp then print(p.Name, hrp.Position) end end end
Quick Start
Open the Onyx UI, make sure OnyxCore is attached to a running Roblox game, then paste a script into the Executor tab and press Execute. The output panel shows print/warn results. Scripts persist across tabs — use the tab system to organize multiple scripts.
-- Basic example: teleport local player local lp = game:GetService("Players").LocalPlayer local hrp = lp.Character:FindFirstChild("HumanoidRootPart") if hrp then hrp.CFrame = CFrame.new(0, 100, 0) end
Environment Globals
Core environment functions available in every script.
game:GetService("ServiceName") to access services.Output
Functions for printing to the Onyx output panel.
Script Analysis
Tools for inspecting and decompiling scripts in the game.
Input Simulation
Simulate keyboard and mouse input at the OS level.
Keyboard
Mouse
Memory Access
Low-level memory read/write for advanced use.
Networking
HTTP requests and data encoding.
Utility
Clipboard, FFlags, and rendering helpers.
Type Vector3
3D vector with full operator overloading and method support.
Constructors
| Constructor | Returns | Description |
|---|---|---|
| Vector3.new(x?, y?, z?) | Vector3 | Creates a new Vector3. Defaults to 0, 0, 0. |
| Vector3.zero | Vector3 | Constant (0, 0, 0) |
| Vector3.one | Vector3 | Constant (1, 1, 1) |
| Vector3.xAxis | Vector3 | Constant (1, 0, 0) |
| Vector3.yAxis | Vector3 | Constant (0, 1, 0) |
| Vector3.zAxis | Vector3 | Constant (0, 0, 1) |
Properties
| Property | Type | Description |
|---|---|---|
| X | number | X component |
| Y | number | Y component |
| Z | number | Z component |
| Magnitude | number | Length of the vector |
| Unit | Vector3 | Normalized direction (length 1) |
Methods
| Method | Returns | Description |
|---|---|---|
| Abs() | Vector3 | Absolute value of each component |
| Ceil() | Vector3 | Ceiling of each component |
| Floor() | Vector3 | Floor of each component |
| Sign() | Vector3 | Sign (-1, 0, or 1) of each component |
| Dot(other) | number | Dot product |
| Cross(other) | Vector3 | Cross product |
| Lerp(goal, alpha) | Vector3 | Linear interpolation |
| Angle(other) | number | Angle between vectors in radians |
| FuzzyEq(other, eps?) | boolean | Approximate equality (default epsilon 1e-5) |
| Max(other) | Vector3 | Component-wise maximum |
| Min(other) | Vector3 | Component-wise minimum |
Operators
Supports + - * / (vector-vector and vector-scalar), unary -, and ==.
local a = Vector3.new(1, 2, 3) local b = Vector3.new(4, 5, 6) print(a + b) -- 5, 7, 9 print(a:Dot(b)) -- 32 print(a:Cross(b)) -- -3, 6, -3 print(a.Magnitude) -- 3.7416... print(a.Unit) -- normalized
Type Vector2
2D vector for screen coordinates and UI positioning.
Constructors
| Constructor | Returns | Description |
|---|---|---|
| Vector2.new(x?, y?) | Vector2 | Creates a new Vector2. Defaults to 0, 0. |
| Vector2.zero | Vector2 | Constant (0, 0) |
| Vector2.one | Vector2 | Constant (1, 1) |
Properties
| Property | Type | Description |
|---|---|---|
| X | number | X component |
| Y | number | Y component |
| Magnitude | number | Length of the vector |
| Unit | Vector2 | Normalized direction |
Operators
Supports + - * (vector-vector and vector-scalar).
Type CFrame
Coordinate frame — position + 3x3 rotation matrix. The fundamental transform type for 3D positioning.
Constructors
| Constructor | Args | Description |
|---|---|---|
| CFrame.new() | 0 | Identity CFrame at origin |
| CFrame.new(x, y, z) | 3 | Position only, identity rotation |
| CFrame.new(x,y,z, qx,qy,qz,qw) | 7 | Position + quaternion rotation |
| CFrame.new(x,y,z, r00..r22) | 12 | Position + full rotation matrix |
| CFrame.identity | — | Constant identity CFrame |
| CFrame.Angles(rx, ry, rz) | 3 | Rotation from Euler angles (radians) |
| CFrame.fromOrientation(rx, ry, rz) | 3 | Rotation from orientation angles |
Properties
| Property | Type | Description |
|---|---|---|
| X, Y, Z | number | Position components |
| Position | Vector3 | Position as a Vector3 |
| LookVector | Vector3 | Forward direction (-Z axis of rotation) |
| RightVector | Vector3 | Right direction (X axis of rotation) |
| UpVector | Vector3 | Up direction (Y axis of rotation) |
| R00 — R22 | number | Individual rotation matrix components |
Methods
| Method | Returns | Description |
|---|---|---|
| GetComponents() | 12 numbers | Returns x, y, z, R00..R22 |
| Inverse() | CFrame | Inverse of this CFrame |
| Lerp(goal, alpha) | CFrame | Linear interpolation |
| PointToWorldSpace(v3) | Vector3 | Transform a point from local to world space |
| PointToObjectSpace(v3) | Vector3 | Transform a point from world to local space |
| VectorToWorldSpace(v3) | Vector3 | Rotate a direction vector to world space |
| VectorToObjectSpace(v3) | Vector3 | Rotate a direction vector to local space |
| ToEulerAnglesXYZ() | 3 numbers | Returns rx, ry, rz in radians |
| ToOrientation() | 3 numbers | Returns rx, ry, rz orientation angles |
Operators
CFrame * CFrame composes transforms. CFrame * Vector3 transforms a point. == compares positions.
local cf = CFrame.new(10, 50, 10) * CFrame.Angles(0, math.rad(45), 0) print(cf.Position) -- 10, 50, 10 print(cf.LookVector) -- forward direction local rx, ry, rz = cf:ToEulerAnglesXYZ()
Type Color3
RGB color with components in the 0–1 range.
Constructors
| Constructor | Description |
|---|---|
| Color3.new(r?, g?, b?) | Components in 0–1 range |
| Color3.fromRGB(r, g, b) | Components in 0–255 range |
| Color3.fromHSV(h, s, v) | From hue/saturation/value |
| Color3.fromHex(hex) | From hex string ("#FF0000" or "FF0000") |
Properties & Methods
| Name | Type | Description |
|---|---|---|
| R, G, B | number | Color channels (0–1) |
| Lerp(goal, alpha) | Color3 | Linear interpolation between colors |
| ToHSV() | 3 numbers | Convert to hue, saturation, value |
local red = Color3.fromRGB(255, 0, 0) local blue = Color3.new(0, 0, 1) local purple = red:Lerp(blue, 0.5) print(purple.R, purple.G, purple.B)
Instance Bridge
Instances are proxy tables backed by live memory addresses. Accessing properties triggers external memory reads from the Roblox process. The bridge emulates the Roblox Instance API.
Instance Methods
| Method | Returns | Description |
|---|---|---|
| FindFirstChild(name, recursive?) | Instance? | Find a child by name |
| FindFirstChildOfClass(className) | Instance? | Find a child by class name |
| FindFirstChildWhichIsA(className) | Instance? | Find a child that inherits from class |
| WaitForChild(name, timeout?) | Instance? | Wait for a child to exist |
| GetChildren() | table | Returns all direct children |
| GetDescendants() | table | Returns all descendants recursively |
| IsA(className) | boolean | Check if instance inherits from class |
| IsDescendantOf(ancestor) | boolean | Check ancestry |
| GetFullName() | string | Full path from DataModel root |
| Destroy() | — | Removes from parent (local only) |
| Clone() | Instance | Shallow copy (local only) |
| GetAttribute(name) | any | Get an attribute value |
| GetAttributes() | table | Get all attributes |
Common Properties (all instances)
| Property | Type | Description |
|---|---|---|
| Name | string | Instance name |
| ClassName | string | Class name (read from ClassDescriptor) |
| Parent | Instance? | Parent instance |
| Address | number | Raw memory address (Onyx-specific) |
Services
Access via game:GetService("Name"). Supported services and their special functionality:
Players:GetPlayers() — Returns all Player instances.Players.LocalPlayer — The local player instance.Player objects expose:
.Character, .Name, .DisplayName, .UserId, .Team, :GetMouse()
workspace.CurrentCamera — The active Camera instance.Camera exposes:
.FieldOfView, .ViewportSize, .Position (Vector3), .CFrame (with full rotation)
:JSONEncode(table) — Serialize table to JSON string.:JSONDecode(string) — Parse JSON string to table.:GenerateGUID(wrapInBraces?) — Generate a random UUID.
.RenderStepped, .Heartbeat, .Stepped, .InputBegan, .InputEnded, .InputChangedInstance Properties
Properties are read directly from Roblox process memory at known struct offsets.
BasePart
| Property | Type | Description |
|---|---|---|
| Position | Vector3 | World position |
| CFrame | CFrame | Full transform with rotation matrix |
| Size | Vector3 | Part dimensions |
| Velocity | Vector3 | Linear velocity |
| AssemblyLinearVelocity | Vector3 | Assembly physics velocity |
| Color | Color3 | Part color |
| CanCollide | boolean | Collision flag |
| Transparency | number | Transparency value |
Humanoid
| Property | Type | Description |
|---|---|---|
| Health | number | Current health |
| MaxHealth | number | Maximum health |
| WalkSpeed | number | Walk speed |
| JumpPower | number | Jump power |
ValueBase Objects
All ValueBase descendants are supported: StringValue, IntValue, NumberValue, BoolValue, ObjectValue, Vector3Value, CFrameValue, Color3Value.
local sv = workspace:FindFirstChild("MyStringValue") print(sv.Value) -- reads the .Value property
GUI Objects
| Property | Type | Applies To |
|---|---|---|
| AbsoluteSize | Vector2 | GuiBase2D descendants |
| AbsolutePosition | Vector2 | GuiBase2D descendants |
| Text | string | TextLabel, TextButton, TextBox |
Other
| Property | Type | Applies To |
|---|---|---|
| TextureId | string | MeshPart |
| MeshId | string | MeshPart |
| JobId | string | DataModel |
Drawing Library
Create overlay shapes rendered on top of the game via the Onyx overlay. Objects are rendered on the Electron overlay window through a WebSocket bridge.
local circle = Drawing.new("Circle") circle.Position = Vector2.new(500, 400) circle.Radius = 50 circle.Color = Color3.fromRGB(255, 0, 0) circle.Filled = true circle.Visible = true
Shared Properties (all types)
| Property | Type | Default |
|---|---|---|
| Visible | boolean | false |
| Color | Color3 | white |
| Transparency | number | 0 |
| ZIndex | number | 0 |
| Position | Vector2 | (0, 0) |
Line
| Property | Type | Default |
|---|---|---|
| From | Vector2 | (0, 0) |
| To | Vector2 | (100, 100) |
| Thickness | number | 1 |
Circle
| Property | Type | Default |
|---|---|---|
| Radius | number | 50 |
| NumSides | number | 64 |
| Thickness | number | 1 |
| Filled | boolean | false |
Square
| Property | Type | Default |
|---|---|---|
| Size | Vector2 | (100, 100) |
| Filled | boolean | false |
| Corner | number | 0 |
Triangle
| Property | Type | Default |
|---|---|---|
| PointA | Vector2 | (0, 0) |
| PointB | Vector2 | (50, 100) |
| PointC | Vector2 | (100, 0) |
| Filled | boolean | false |
Text
| Property | Type | Default |
|---|---|---|
| Text | string | "" |
| Font | number | 0 (UI) |
| FontSize | number | 16 |
| Center | boolean | false |
| Outline | boolean | false |
Image
| Property | Type | Default |
|---|---|---|
| Data | string | "" |
| Size | Vector2 | (50, 50) |
| Rounding | number | 0 |
Drawing.Fonts
| Name | Value |
|---|---|
| Drawing.Fonts.UI | 0 |
| Drawing.Fonts.System | 1 |
| Drawing.Fonts.SystemBold | 2 |
| Drawing.Fonts.Minecraft | 3 |
| Drawing.Fonts.Monospace | 4 |
| Drawing.Fonts.Pixel | 5 |
| Drawing.Fonts.Fortnite | 6 |
task Library
Coroutine scheduling utilities matching the Roblox task library.