# Table of Contents - [Vector Lua Engine](#vector-lua-engine) - [Navigating The UI | Vector Lua Engine](#navigating-the-ui-vector-lua-engine) - [Entity API | Vector Lua Engine](#entity-api-vector-lua-engine) - [Draw API | Vector Lua Engine](#draw-api-vector-lua-engine) - [Raycast API | Vector Lua Engine](#raycast-api-vector-lua-engine) - [Game API | Vector Lua Engine](#game-api-vector-lua-engine) - [Thread API | Vector Lua Engine](#thread-api-vector-lua-engine) - [Utility API | Vector Lua Engine](#utility-api-vector-lua-engine) - [Menu API | Vector Lua Engine](#menu-api-vector-lua-engine) - [FFlag API | Vector Lua Engine](#fflag-api-vector-lua-engine) --- # Vector Lua Engine The Vector Lua Engine lets you write scripts that run inside the cheat. Scripts can read game state, draw to the screen, add menu elements, and run background tasks — all through a safe, sandboxed Lua 5.1 environment. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#naming-convention) Naming convention Every function in the API is registered under three naming styles simultaneously. You can use whichever you prefer — just stay consistent within a script. Style Example `snake_case` `entity.get_players()` `camelCase` `entity.getPlayers()` `PascalCase` `entity.GetPlayers()` All examples in this documentation use `snake_case`. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#callbacks) Callbacks Scripts respond to engine events by defining global functions. The engine calls them automatically. #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#on_frame) on\_frame Called every render frame. All drawing must happen here. Copy function on_frame() draw.text(10, 10, "script running", {1, 1, 1, 1}) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#on_player_added) on\_player\_added Called when a player joins the game. Copy function on_player_added(player) print(player.name .. " joined") end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#on_player_removed) on\_player\_removed Called when a player leaves the game. Copy function on_player_removed(player) print(player.name .. " left") end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#available-globals) Available globals Global Description `draw` 2D rendering — lines, boxes, text, circles `entity` Player list, local player, player properties `game` DataModel, instances, camera, input, parts `camera` Camera position, look vector, FOV `input` Key state, mouse position, mouse movement `part` Write part properties (position, size, velocity) `menu` Add UI elements, read/write values `thread` Background timer-based callbacks `utility` Screen projection, delta time, FPS, tick count `Vector3` 3D vector constructor `print` Logs to the script console * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#minimal-working-script) Minimal working script Copy -- Setup menu elements once at script load menu.add_tab("My Script", "M") menu.add_group("My Script", "General") menu.add_checkbox("My Script", "General", "enabled", "Enable", true) -- on_frame runs every render frame function on_frame() if not menu.get("enabled") then return end local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local b = p:get_bounds() if not b.valid then goto continue end draw.box(b.x, b.y, b.w, b.h, {1, 1, 1, 1}) draw.health_bar(b.x - 5, b.y, b.h, p.health, p.max_health) draw.text(b.x, b.y - 16, p.name, {1, 1, 1, 1}) ::continue:: end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#environment) Environment The engine opens a restricted subset of the Lua 5.1 standard library: Available Removed `table`, `string`, `math`, `bit`, `os`, `io, loadstring` `loadfile`, `dofile`, `load` `os.time`, `os.date`, `os.clock` `os.execute`, `os.exit`, `os.remove` `io.open`, `io.read`, `io.write` `io.popen` `tostring`, `tonumber`, `type`, `pairs`, `ipairs` `string.dump`, `collectgarbage` * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#script-lifecycle) Script lifecycle Copy Script loaded └─ Top-level code runs once └─ Menu elements registered └─ Threads created (if any) └─ Callbacks defined Every frame └─ on_frame() called (if defined) Player joins └─ on_player_added(player) called (if defined) Player leaves └─ on_player_removed(player) called (if defined) Script unloaded └─ All threads stopped automatically └─ Menu elements cleared * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine#tips) Tips * Register menu elements at the top level of your script, outside `on_frame`. They only need to be created once. * Create threads at the top level or with a nil-guard inside `on_frame`. Never call `thread.create` unconditionally inside `on_frame` — it runs every frame. * Use `utility.get_delta_time()` for any time-based animation or movement so it stays frame-rate independent. * Use `:get_bounds()` for box ESP. Use `:get_bone_screen()` for specific bone positions. Use `:get_bones_screen()` when you need multiple bones — it batches the reads. * `p.health`, `p.position`, and `p.head_position` are live memory reads. Cache them into locals if you read them more than once per frame. Copy -- good: read once, use multiple times local hp = p.health local max_hp = p.max_health local ratio = hp / max_hp draw.health_bar(b.x - 5, b.y, b.h, hp, max_hp) draw.text(b.x, b.y - 16, math.floor(hp) .. " / " .. math.floor(max_hp), {1,1,1,1}) [NextNavigating The UIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/introduction/navigating-the-ui) Last updated 1 month ago --- # Navigating The UI | Vector Lua Engine Master the Vector interface. This documentation covers the fundamental workflow of our scripting environment, from initial UI orientation to script execution. ![](https://project-vector-1.gitbook.io/vector-lua-engine/~gitbook/image?url=https%3A%2F%2F3837052837-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FrN6pA26rSos6PkS9Yp9p%252Fuploads%252FxX7gN7A2a5EP2QpFbtnx%252F%257B0152ED0B-AECF-49B7-9915-03C8E4848EEC%257D.png%3Falt%3Dmedia%26token%3D2a085945-bfa8-4a5e-965b-8720ce866ebb&width=768&dpr=3&quality=100&sign=32417508&sv=2) To get started simply press **Create Script** in the script editor ![](https://project-vector-1.gitbook.io/vector-lua-engine/~gitbook/image?url=https%3A%2F%2F3837052837-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FrN6pA26rSos6PkS9Yp9p%252Fuploads%252F2RsTp88WR6wiUtHWLoXo%252F%257B89CD21A7-ECE5-4F95-973C-D22119FE4349%257D.png%3Falt%3Dmedia%26token%3Dc42a3ec2-5cfd-400d-8ba8-ef1ca568d6d8&width=768&dpr=3&quality=100&sign=9b745d22&sv=2) Once your script is made, you can see we have many options * Execute Script * Load Script * Unload Script * New Script * Refresh Script List * Open Folder ![](https://project-vector-1.gitbook.io/vector-lua-engine/~gitbook/image?url=https%3A%2F%2F3837052837-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FrN6pA26rSos6PkS9Yp9p%252Fuploads%252Fw2ykZ48uIgmu6LeaKoVT%252F%257BA2714249-6850-4CF7-AF20-4E24DFD660AC%257D.png%3Falt%3Dmedia%26token%3D04eeae3c-5d8f-4b83-a815-c279d5c7e96a&width=768&dpr=3&quality=100&sign=bb866129&sv=2) We can also right click to open the context menu to show more options ![](https://project-vector-1.gitbook.io/vector-lua-engine/~gitbook/image?url=https%3A%2F%2F3837052837-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FrN6pA26rSos6PkS9Yp9p%252Fuploads%252Fr4rScaxPp0vNWtheNkH9%252F%257BDFB2E701-B31B-42E4-A81F-F76C67956A08%257D.png%3Falt%3Dmedia%26token%3D961b9f14-d6b2-471b-9b54-452f4baa4469&width=768&dpr=3&quality=100&sign=bf158493&sv=2) [PreviousVector Lua Enginechevron-left](https://project-vector-1.gitbook.io/vector-lua-engine) [NextThread APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api) Last updated 3 months ago --- # Entity API | Vector Lua Engine The entity API provides access to cached player data. Player objects are snapshots updated each frame. Properties marked as **live** perform a memory read on every access. All others are read from the frame cache. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. Pick one and stay consistent in your scripts. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#entity.get_players) entity.get\_players Copy local players = entity.get_players() Returns a table of all valid player objects currently in the game. Includes both Players service characters and workspace entities (NPCs, bots). * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#entity.get_local_player) entity.get\_local\_player Copy local me = entity.get_local_player() Returns the local player object, or nil if not available. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#entity.get_player_count) entity.get\_player\_count Copy local count = entity.get_player_count() Returns the number of valid players in the cache. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#player-object) Player Object #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#cached-properties) Cached Properties Read from the frame snapshot, no memory cost. Property Type Description `name` string Player username `display_name` string Display name `user_id` number Roblox user ID (0 for NPCs) `team` string Team name `has_team` bool Whether the player is on a team `tool_name` string Name of equipped tool `is_local` bool True if this is the local player `is_valid` bool True if the player data is valid `is_workspace_entity` bool True if found via workspace scan (NPC/bot) `rig_type` string "R15", "R6", or "Unknown" #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#live-properties) Live Properties Each access performs a memory read. These reflect the current game state. Property Type Description `health` number Current health `max_health` number Maximum health `is_alive` bool True if health > 0 `is_dead` bool True if health <= 0 `position` Vector3 Root part world position `velocity` Vector3 Root part linear velocity `head_position` Vector3 Head world position `look_vector` Vector3 Head forward direction `move_direction` Vector3 Humanoid move direction `camera_offset` Vector3 Humanoid camera offset `walk_speed` number Current walk speed `jump_power` number Current jump power `jump_height` number Current jump height `hip_height` number Hip height `max_slope_angle` number Maximum walkable slope angle `state` number Humanoid state enum value `state_name` string Humanoid state as a readable string `sit` bool True if seated `is_jumping` bool True if jump is active `platform_stand` bool Platform standing state `auto_rotate` bool Auto rotate enabled `is_walking` bool True if currently walking `floor_material` number Material enum of the floor #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#instance-references) Instance References These return game API instance objects for interop with the `game` API. Property Type Description `character` Instance Character model `humanoid` Instance Humanoid instance `player` Instance Player service object #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#writable-properties) Writable Properties Player objects support direct property writes through assignment. These write to game memory immediately. **Humanoid writes** (require humanoid): Property Type Description `health` number Set health `max_health` number Set max health `walk_speed` number Set walk speed `jump_power` number Set jump power `jump_height` number Set jump height `hip_height` number Set hip height `max_slope_angle` number Set max slope angle `state` number Set humanoid state enum `sit` bool Set seated state `jump` bool Trigger/cancel jump `platform_stand` bool Set platform standing `auto_rotate` bool Set auto rotate `auto_jump_enabled` bool Set auto jump `use_jump_power` bool Toggle jump power vs height `requires_neck` bool Set requires neck joint `break_joints_on_death` bool Set break joints on death `evaluate_state_machine` bool Enable/disable state machine `camera_offset` Vector3 Set humanoid camera offset `walkspeed_check` number Anti-cheat walkspeed mirror **Primitive writes** (require root\_primitive): Property Type Description `position` Vector3 Set root position `velocity` Vector3 Set linear velocity `angular_velocity` Vector3 Set angular velocity `anchored` bool Set anchored flag `can_collide` bool Set collision flag `can_query` bool Set query flag `can_touch` bool Set touch flag * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#player-methods) Player Methods #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#get_bone_screen-bone_name) :get\_bone\_screen(bone\_name) Copy local sx, sy, visible = p:get_bone_screen(bone_name) Returns the screen position of a named bone and a boolean indicating whether it is on screen. Copy local sx, sy, visible = p:get_bone_screen("Head") if visible then draw.circle_filled(sx, sy, 4, {1, 1, 0, 1}) end Supported R6 bones: `Head`, `Torso`, `Left Arm`, `Right Arm`, `Left Leg`, `Right Leg`, `HumanoidRootPart` Supported R15 bones: `Head`, `UpperTorso`, `LowerTorso`, `LeftUpperArm`, `LeftLowerArm`, `LeftHand`, `RightUpperArm`, `RightLowerArm`, `RightHand`, `LeftUpperLeg`, `LeftLowerLeg`, `LeftFoot`, `RightUpperLeg`, `RightLowerLeg`, `RightFoot`, `HumanoidRootPart` * * * #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#get_bones_screen) :get\_bones\_screen() Copy local bones = p:get_bones_screen() Returns a table of all valid bones projected to screen space. Keys are bone name strings, values are `{x, y}` tables. Copy local bones = p:get_bones_screen() if bones["Head"] and bones["UpperTorso"] then draw.line( bones["Head"][1], bones["Head"][2], bones["UpperTorso"][1], bones["UpperTorso"][2], {1, 1, 1, 1} ) end * * * #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#get_bounds) :get\_bounds() Copy local b = p:get_bounds() Returns a bounding box table with fields `x`, `y`, `w`, `h`, and `valid`. Copy local b = p:get_bounds() if b.valid then draw.box(b.x, b.y, b.w, b.h, {1, 1, 1, 1}) end * * * #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#distance_to-point) :distance\_to(point) Copy local dist = p:distance_to(point) local dist = p:distance_to() -- defaults to camera position Returns the distance from the player's root position to a point. If no argument is given, returns distance to the camera. Copy local me = entity.get_local_player() for _, p in ipairs(entity.get_players()) do if not p.is_local then local dist = p:distance_to(me.position) print(p.name .. " is " .. math.floor(dist) .. " studs away") end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#humanoid-states) Humanoid States The `state` property returns a numeric enum. Use `state_name` for a readable string. Value Name Description 0 FallingDown Tripped/falling down 1 Ragdoll Ragdolled 2 GettingUp Recovering from fall 3 Jumping Jumping upward 4 Swimming In water 5 Freefall Falling through air 6 Flying Flying 7 Landed Just landed 8 Running Running/walking (default) 10 RunningNoPhysics Server-controlled running 11 StrafingNoPhysics Server-controlled strafing 12 Climbing Climbing a ladder/truss 13 Seated Sitting in a seat 14 PlatformStanding Standing on a platform 15 Dead Dead 16 Physics Physics-controlled 18 None No state / disabled * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#examples) Examples #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#full-esp-loop) Full ESP loop Copy function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local b = p:get_bounds() if not b.valid then goto continue end draw.box(b.x, b.y, b.w, b.h, {1, 1, 1, 1}) draw.health_bar(b.x - 5, b.y, b.h, p.health, p.max_health) local tw, th = draw.get_text_size(p.name, 14) draw.text(b.x + b.w / 2 - tw / 2, b.y - th - 2, p.name, {1, 1, 1, 1}) local hx, hy, hv = p:get_bone_screen("Head") if hv then draw.circle_filled(hx, hy, 3, {1, 1, 0, 1}) end ::continue:: end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#state-display) State display Copy function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local sx, sy, vis = p:get_bone_screen("Head") if vis then local state = p.state_name if state ~= "Running" then local tw, th = draw.get_text_size(state, 12) draw.text(sx - tw / 2, sy - 30, state, {1, 0.8, 0.2, 1}) end end ::continue:: end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#speed-modification) Speed modification Copy local me = entity.get_local_player() if me then me.walk_speed = 50 me.jump_power = 100 print("Speed: " .. me.walk_speed) print("Jump: " .. me.jump_power) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#force-state) Force state Copy local me = entity.get_local_player() if me then me.state = 6 -- set to Flying print("State: " .. me.state_name) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#disable-collision-on-all-nearby-players) Disable collision on all nearby players Copy function on_frame() local me = entity.get_local_player() if not me then return end for _, p in ipairs(entity.get_players()) do if not p.is_local and p:distance_to(me.position) < 20 then p.can_collide = false end end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#skeleton-rendering) Skeleton rendering Copy local connections_r15 = { {"Head", "UpperTorso"}, {"UpperTorso", "LowerTorso"}, {"UpperTorso", "LeftUpperArm"}, {"LeftUpperArm", "LeftLowerArm"}, {"LeftLowerArm", "LeftHand"}, {"UpperTorso", "RightUpperArm"}, {"RightUpperArm", "RightLowerArm"}, {"RightLowerArm", "RightHand"}, {"LowerTorso", "LeftUpperLeg"}, {"LeftUpperLeg", "LeftLowerLeg"}, {"LeftLowerLeg", "LeftFoot"}, {"LowerTorso", "RightUpperLeg"}, {"RightUpperLeg", "RightLowerLeg"}, {"RightLowerLeg", "RightFoot"}, } function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end if p.rig_type ~= "R15" then goto continue end local bones = p:get_bones_screen() for _, conn in ipairs(connections_r15) do local a = bones[conn[1]] local b = bones[conn[2]] if a and b then draw.line(a[1], a[2], b[1], b[2], {1, 1, 1, 0.8}) end end ::continue:: end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api#api-reference) API Reference Function Returns Description `entity.get_players()` table All cached player objects `entity.get_local_player()` player/nil Local player object `entity.get_player_count()` number Player count `player:get_bone_screen(name)` x, y, visible Screen position of a bone `player:get_bones_screen()` table All bones as screen positions `player:get_bounds()` table Bounding box {x, y, w, h, valid} `player:distance_to(vec3?)` number Distance to point or camera [PreviousMenu APIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api) [NextDraw APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api) Last updated 5 days ago --- # Draw API | Vector Lua Engine The draw API renders 2D primitives, polygons, and chams onto the game's background draw list. All draw calls must happen inside `on_frame`. Every primitive automatically draws a black shadow/outline for screen readability. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. Pick one and stay consistent in your scripts. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#coordinate-system) Coordinate system * Origin is the top-left corner of the screen * X increases to the right, Y increases downward * Use `draw.world_to_screen` or `utility.world_to_screen` to convert 3D world positions * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#colors) Colors Colors are passed as tables with four normalized floats: `{r, g, b, a}` where each value is in the range `0.0 – 1.0`. Copy {1, 1, 1, 1} -- white, fully opaque {1, 0, 0, 1} -- red {0, 0.8, 1, 1} -- cyan {1, 0, 0, 0.5} -- red, half transparent * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.line) draw.line Copy draw.line(x1, y1, x2, y2, color, thickness) Parameter Type Default Description `x1, y1` number required Start point `x2, y2` number required End point `color` table required RGBA color `thickness` number `1.0` Line thickness in pixels Copy draw.line(100, 100, 400, 300, {1, 0, 0, 1}) draw.line(100, 100, 400, 300, {1, 0, 0, 1}, 2.0) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.rect) draw.rect Copy draw.rect(x, y, w, h, color, rounding, thickness) Draws an outlined rectangle. Copy draw.rect(50, 50, 200, 100, {1, 1, 1, 1}) draw.rect(50, 50, 200, 100, {1, 1, 1, 1}, 4.0, 1.5) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.rect_filled) draw.rect\_filled Copy draw.rect_filled(x, y, w, h, color, rounding) Copy draw.rect_filled(50, 50, 200, 100, {0, 0, 0, 0.6}) draw.rect_filled(50, 50, 200, 100, {0.2, 0.5, 1, 0.8}, 6.0) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.circle) draw.circle Copy draw.circle(x, y, radius, color, segments, thickness) Copy draw.circle(500, 400, 80, {1, 1, 1, 0.5}) draw.circle(500, 400, 80, {1, 1, 1, 0.5}, 64, 1.5) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.circle_filled) draw.circle\_filled Copy draw.circle_filled(x, y, radius, color, segments) Copy draw.circle_filled(500, 400, 5, {1, 0.8, 0, 1}) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.text) draw.text Copy draw.text(x, y, text, color, size) Renders text with a solid black outline on all four diagonals. Parameter Default `size` `14.0` Copy draw.text(100, 100, "hello world", {1, 1, 1, 1}) draw.text(100, 100, "hello world", {1, 1, 0, 1}, 18.0) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.get_text_size) draw.get\_text\_size Copy local w, h = draw.get_text_size(text, size) Returns the pixel dimensions of a string at a given font size. Copy local tw, th = draw.get_text_size("Player", 14.0) draw.text(box_x + box_w / 2 - tw / 2, box_y - th - 2, "Player", {1, 1, 1, 1}) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.box) draw.box Copy draw.box(x, y, w, h, color, rounding, style) High-level ESP box. `style`: `0` = normal rect, `1` = corner box. Copy draw.box(b.x, b.y, b.w, b.h, {1, 1, 1, 1}) draw.box(b.x, b.y, b.w, b.h, {1, 1, 1, 1}, 0, 1) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.corner_box) draw.corner\_box Copy draw.corner_box(x, y, w, h, color) Copy draw.corner_box(b.x, b.y, b.w, b.h, {0, 1, 1, 1}) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.health_bar) draw.health\_bar Copy draw.health_bar(x, y, height, health, max_health) Draws a vertical health bar to the left of the given position. Color transitions automatically. Copy draw.health_bar(b.x - 5, b.y, b.h, p.health, p.max_health) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.world_to_screen) draw.world\_to\_screen Copy local sx, sy, visible = draw.world_to_screen(x, y, z) Projects a 3D world position onto the screen. Copy local sx, sy, on_screen = draw.world_to_screen(pos.x, pos.y, pos.z) if on_screen then draw.circle_filled(sx, sy, 4, {1, 1, 0, 1}) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.get_screen_size) draw.get\_screen\_size Copy local w, h = draw.get_screen_size() * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.window) draw.window Copy local w, h = draw.window(x, y, id, title, items) Renders a minimal floating info panel with a title and list of text rows. Copy draw.window(b.x + b.w + 4, b.y, "info_" .. p.user_id, p.name, { "HP: " .. math.floor(p.health), "Team: " .. p.team, }) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#polygon-drawing) Polygon drawing #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.poly) draw.poly Copy draw.poly(points, color, thickness) Draws an open polyline through a list of `{x, y}` screen points. Parameter Type Default Description `points` table required `{{x,y}, {x,y}, ...}` `color` table required RGBA color `thickness` number `1.5` Line thickness Copy draw.poly({{100,100},{200,50},{300,100}}, {0, 1, 1, 1}) * * * #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.poly_closed) draw.poly\_closed Copy draw.poly_closed(points, color, thickness) Same as `draw.poly` but closes the last vertex back to the first, forming a complete shape. Copy draw.poly_closed({{100,100},{200,50},{300,100}}, {1, 0.5, 0, 1}, 2.0) * * * #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.poly_filled) draw.poly\_filled Copy draw.poly_filled(points, color) Draws a filled convex polygon. Points must be in convex hull order — run them through `draw.compute_hull` first if they are unordered. Copy local hull = draw.compute_hull(my_points) draw.poly_filled(hull, {0, 1, 0, 0.4}) draw.poly_closed(hull, {0, 1, 0, 1}) * * * #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.compute_hull) draw.compute\_hull Copy local hull = draw.compute_hull(points) Takes an unordered list of `{x, y}` screen points and returns them as an ordered convex hull. Required before `draw.poly_filled` or `draw.poly_closed` if your input points aren't already in convex order. Copy local pts = {{300,100},{100,100},{200,50},{150,200},{250,200}} local hull = draw.compute_hull(pts) draw.poly_filled(hull, {1, 0, 0, 0.3}) draw.poly_closed(hull, {1, 0, 0, 1}) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#chams) Chams #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.chams_player) draw.chams\_player Copy draw.chams_player(player, color, style) draw.chams_player(player, color, color2, style) Renders chams on a player from `entity.get_players()`. Builds per-body-part convex hulls identically to the cheat's own chams system and renders them through `drawing.draw_chams`, so the output matches exactly. Parameter Type Default Description `player` player object required From `entity.get_players()` `color` table required RGBA base color `color2` table optional RGBA second color — enables gradient chams `style` number `0` `0` = filled, `1` = outline, `2` = glow Copy -- solid filled chams draw.chams_player(p, {0, 1, 0.4, 0.8}, 0) -- gradient glow chams draw.chams_player(p, {0, 1, 0.4, 0.8}, {0, 0.4, 1, 0.8}, 2) -- outline only draw.chams_player(p, {1, 1, 0, 1}, 1) * * * #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#draw.get_player_hulls) draw.get\_player\_hulls Copy local hulls = draw.get_player_hulls(player) Returns each body part's screen-space convex hull as a table of polygon tables. Use this when you want to draw the hulls yourself with custom rendering instead of using `draw.chams_player`. Each entry in `hulls` is a `{{x,y},...}` table ready to pass directly to `draw.poly_filled` or `draw.poly_closed`. Copy local hulls = draw.get_player_hulls(p) for _, hull in ipairs(hulls) do draw.poly_filled(hull, {1, 0, 0, 0.3}) draw.poly_closed(hull, {1, 0, 0, 1}, 1.5) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#examples) Examples **Full ESP with chams:** Copy function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end -- chams behind everything draw.chams_player(p, {0, 0.8, 1, 0.6}, {0, 0.3, 1, 0.6}, 2) local b = p:get_bounds() if not b.valid then goto continue end draw.box(b.x, b.y, b.w, b.h, {1, 1, 1, 1}) draw.health_bar(b.x - 5, b.y, b.h, p.health, p.max_health) local tw, th = draw.get_text_size(p.name, 14) draw.text(b.x + b.w / 2 - tw / 2, b.y - th - 2, p.name, {1, 1, 1, 1}) ::continue:: end end **Custom chams with per-hull color:** Copy function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local hulls = draw.get_player_hulls(p) local visible = raycast.is_player_visible(p.character.address) local fill_color = visible and {0, 1, 0.4, 0.35} or {0.5, 0.5, 0.5, 0.2} local outline_color = visible and {0, 1, 0.4, 1} or {0.5, 0.5, 0.5, 0.6} for _, hull in ipairs(hulls) do draw.poly_filled(hull, fill_color) draw.poly_closed(hull, outline_color, 1.5) end ::continue:: end end **Manual polygon from world positions:** Copy function on_frame() local cam = camera.get_position() -- project some world points and draw a shape local world_pts = { {100, 0, 100}, {200, 0, 100}, {200, 0, 200}, {100, 0, 200} } local screen_pts = {} for _, wp in ipairs(world_pts) do local sx, sy, on_screen = draw.world_to_screen(wp[1], wp[2], wp[3]) if on_screen then table.insert(screen_pts, {sx, sy}) end end if #screen_pts >= 3 then local hull = draw.compute_hull(screen_pts) draw.poly_filled(hull, {1, 0.8, 0, 0.3}) draw.poly_closed(hull, {1, 0.8, 0, 1}) end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api#api-reference) API Reference Function Description `draw.line(x1,y1,x2,y2, color, thickness)` Line between two points `draw.rect(x,y,w,h, color, rounding, thickness)` Outlined rectangle `draw.rect_filled(x,y,w,h, color, rounding)` Filled rectangle `draw.circle(x,y,r, color, segs, thickness)` Outlined circle `draw.circle_filled(x,y,r, color, segs)` Filled circle `draw.text(x,y, text, color, size)` Text with outline `draw.get_text_size(text, size)` Text pixel dimensions `draw.box(x,y,w,h, color, rounding, style)` ESP box `draw.corner_box(x,y,w,h, color)` Corner-only ESP box `draw.health_bar(x,y,h, hp, max_hp)` Vertical health bar `draw.world_to_screen(x,y,z)` 3D to screen projection `draw.get_screen_size()` Render resolution `draw.window(x,y, id, title, items)` Floating info panel `draw.poly(points, color, thickness)` Open polyline `draw.poly_closed(points, color, thickness)` Closed polyline `draw.poly_filled(points, color)` Filled convex polygon `draw.compute_hull(points)` Convex hull from unordered points `draw.chams_player(player, color, color2, style)` Full chams on a player `draw.get_player_hulls(player)` Raw per-part hull tables [PreviousEntity APIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api) [NextUtility APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api) Last updated 5 days ago --- # Raycast API | Vector Lua Engine The raycast API gives scripts access to the cheat's built-in visibility system. A background worker thread maintains a spatial hash of world obstacles and per-player visibility results — the Lua API just reads from that cache with no render-thread cost. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api#how-it-works) How it works The raycast system runs on a dedicated worker thread: * **Obstacles** are rebuilt from the workspace instance tree every ~2 seconds into a spatial hash grid (50 unit cells). * **Player visibility** is rechecked every ~16ms against those obstacles, testing head, upper torso, lower torso, and torso for each enemy player. * Lua reads the already-computed results — there is no per-frame cost beyond a hash lookup. `raycast.is_ready()` returns false while the first obstacle pass is still running. All functions fail open (return `true`) if the cache is not ready, so your ESP will still draw during startup. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api#raycast.is_ready) raycast.is\_ready Copy local ready = raycast.is_ready() Returns `true` once the obstacle cache has completed its first build. Use this as a guard if you want to suppress ESP until visibility data is available. Copy function on_frame() if not raycast.is_ready() then draw.text(10, 10, "building raycast cache...", {1, 1, 0, 1}) return end -- normal ESP below end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api#raycast.is_player_visible) raycast.is\_player\_visible Copy local visible = raycast.is_player_visible(character_address) Returns `true` if any key body part of the player is visible from the camera position. Reads directly from the double-buffered visibility cache — no memory reads, no ray tests. The result is updated every ~16ms by the worker thread. **Parameter:** the character's memory address as a number. Obtain it from `p.character.address` on a player object from `entity.get_players()`. Returns `true` if the cache is not yet ready (fail open). Copy function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local b = p:get_bounds() if not b.valid then goto continue end local char = p.character if not utility.is_valid(char) then goto continue end local visible = raycast.is_player_visible(char.address) -- white box when visible, dark grey when occluded local color = visible and {1, 1, 1, 1} or {0.4, 0.4, 0.4, 0.6} draw.box(b.x, b.y, b.w, b.h, color) ::continue:: end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api#raycast.is_visible) raycast.is\_visible Copy -- Six numbers local visible = raycast.is_visible(x1, y1, z1, x2, y2, z2) -- Two Vector3 objects local visible = raycast.is_visible(vec3_from, vec3_to) Fires a ray between two world positions and returns `true` if no obstacle intersects it. Uses the cached spatial hash to limit OBB tests to only the cells along the ray — typically a small fraction of the total obstacle count. More expensive than `is_player_visible` since it runs the test live, but still much cheaper than a full scene traverse. Returns `true` if the cache is not yet ready. Copy function on_frame() local cam_pos = camera.get_position() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local head_pos = p.head_position if not head_pos then goto continue end local visible = raycast.is_visible( cam_pos.x, cam_pos.y, cam_pos.z, head_pos.x, head_pos.y, head_pos.z ) local hx, hy, hv = p:get_bone_screen("Head") if hv then local color = visible and {0, 1, 0, 1} or {1, 0, 0, 1} draw.circle_filled(hx, hy, 5, color) end ::continue:: end end **Vector3 form:** Copy local from = camera.get_position() local to = p.head_position if from and to then local visible = raycast.is_visible(from, to) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api#examples) Examples **Visible-only ESP — skip drawing occluded players entirely:** Copy function on_frame() if not raycast.is_ready() then return end local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local char = p.character if not utility.is_valid(char) then goto continue end -- skip players behind walls entirely if not raycast.is_player_visible(char.address) then goto continue end local b = p:get_bounds() if not b.valid then goto continue end draw.box(b.x, b.y, b.w, b.h, {0, 1, 0.5, 1}) draw.health_bar(b.x - 5, b.y, b.h, p.health, p.max_health) local tw, th = draw.get_text_size(p.name, 14) draw.text(b.x + b.w / 2 - tw / 2, b.y - th - 2, p.name, {1, 1, 1, 1}) ::continue:: end end **Visible/occluded color coding with info window:** Copy function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local char = p.character if not utility.is_valid(char) then goto continue end local visible = raycast.is_player_visible(char.address) local b = p:get_bounds() if not b.valid then goto continue end local box_color = visible and {0, 1, 0.4, 1} or {0.5, 0.5, 0.5, 0.5} draw.box(b.x, b.y, b.w, b.h, box_color) if visible then draw.window(b.x + b.w + 4, b.y, "vis_" .. p.user_id, p.name, { "HP: " .. math.floor(p.health), "Visible: yes", }) end ::continue:: end end **Custom raycast from camera to arbitrary world point:** Copy function on_frame() local cam = camera.get_position() -- check if a fixed world coordinate is visible from the camera local target_x, target_y, target_z = 100, 5, 200 if raycast.is_visible(cam.x, cam.y, cam.z, target_x, target_y, target_z) then local sx, sy, on_screen = utility.world_to_screen(target_x, target_y, target_z) if on_screen then draw.circle_filled(sx, sy, 6, {0, 1, 0, 1}) draw.text(sx + 8, sy, "visible", {0, 1, 0, 1}) end end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api#performance-notes) Performance notes * `raycast.is_player_visible` is essentially free — it's a single table scan of the visibility buffer which contains at most one entry per player. * `raycast.is_visible` runs a live ray test but uses the spatial hash, so it only tests the OBBs in cells the ray actually passes through. Calling it once per player per frame is fine. Calling it dozens of times per frame for many players may add up — prefer `is_player_visible` for per-player visibility checks. * The obstacle cache rebuilds every ~2 seconds. Freshly spawned parts (doors opening, destructible walls) will not be reflected until the next rebuild. * Transparent parts (transparency >= 1.0) are excluded from the obstacle list — they won't block visibility. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api#api-reference) API Reference Function Returns Description `raycast.is_ready()` boolean True once the obstacle cache is built `raycast.is_player_visible(char_addr)` boolean Cached visibility check for a player `raycast.is_visible(x1,y1,z1, x2,y2,z2)` boolean Live ray test between two world positions `raycast.is_visible(vec3_from, vec3_to)` boolean Same, accepts Vector3 objects [PreviousUtility APIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api) [NextFFlag APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api) Last updated 5 days ago --- # Game API | Vector Lua Engine The game API exposes the Roblox DataModel hierarchy, camera control, mouse input, and part manipulation. It is split into sub-tables: `game`, `camera`, `input`, `part`, and `utility`. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. Pick one and stay consistent in your scripts. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#game-global) game global `game` mirrors the Roblox DataModel. You can index it by service name or use `game.get_service`. Copy local ws = game.workspace local plrs = game.players local local_player = game.local_player local place_id = game.place_id local game_id = game.game_id #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#game.get_service) game.get\_service Copy local svc = game.get_service("ReplicatedStorage") Supported direct properties: `workspace`, `players`, `lighting`, `local_player`, `place_id`, `game_id`, `replicated_storage`, `replicated_first`, `starter_gui`, `starter_pack`, `starter_player`, `teams`, `sound_service`, `chat` * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#instance-methods) Instance methods Any Instance returned by `game` or `entity` supports these methods: Copy instance:get_children() instance:get_descendants() instance:find_first_child(name) instance:find_first_child(name, true) -- recursive instance:find_first_child_of_class(class) instance:find_first_child_which_is_a(class) instance:find_first_descendant(name) instance:find_first_descendant_of_class(class) instance:find_first_ancestor(name) instance:find_first_ancestor_of_class(class) instance:is_a(class_name) instance:is_descendant_of(ancestor) instance:is_ancestor_of(descendant) #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#write-methods) Write methods Instances also support direct write methods: Copy -- BasePart instance:set_position(x, y, z) instance:set_size(x, y, z) instance:set_velocity(x, y, z) instance:set_angular_velocity(x, y, z) instance:set_transparency(value) instance:set_can_collide(bool) instance:set_anchored(bool) instance:set_can_query(bool) instance:set_can_touch(bool) -- Humanoid instance:set_health(value) instance:set_max_health(value) instance:set_walk_speed(value) instance:set_jump_power(value) instance:set_jump_height(value) instance:set_state(state_id) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#instance-properties) Instance properties All instances support property reads and writes via `__index` and `__newindex`. You can read or assign properties directly. #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#common-properties) Common properties Property Type Access `Name` string read `ClassName` string read `Parent` Instance read `Address` number read #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#basepart-properties) BasePart properties Applies to Part, MeshPart, UnionOperation, WedgePart, SpawnLocation, TrussPart, Seat, VehicleSeat, CornerWedgePart. Property Type Access `Position` Vector3 read/write `Size` Vector3 read/write `Velocity` Vector3 read/write `AngularVelocity` Vector3 read/write `CFrame` Vector3 read/write (position only) `Rotation` table (3x3) read/write `LookVector` Vector3 read `RightVector` Vector3 read `UpVector` Vector3 read `Color` table {R,G,B} read `Transparency` number read/write `Reflectance` number read/write `CanCollide` bool read/write `Anchored` bool read/write `CanQuery` bool read/write `CanTouch` bool read/write `CastShadow` bool read/write `Locked` bool read/write `Massless` bool read/write `Shape` number read Copy local char = game.local_player.character local head = char:find_first_child("Head") if head then print("Position: " .. tostring(head.position)) head.transparency = 0.5 head.can_collide = false head.anchored = true head.reflectance = 1.0 head.cast_shadow = false end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#humanoid-properties) Humanoid properties Property Type Access `Health` number read/write `MaxHealth` number read/write `WalkSpeed` number read/write `JumpPower` number read/write `JumpHeight` number read/write `HipHeight` number read/write `MaxSlopeAngle` number read/write `State` number read/write `StateName` string read `IsAlive` bool read `IsDead` bool read `Sit` bool read/write `Jump` bool read/write `PlatformStand` bool read/write `AutoRotate` bool read/write `AutoJumpEnabled` bool read/write `UseJumpPower` bool read/write `RequiresNeck` bool read/write `BreakJointsOnDeath` bool read/write `EvaluateStateMachine` bool read/write `IsWalking` bool read `WalkspeedCheck` number read/write `WalkTimer` number read `MoveDirection` Vector3 read `CameraOffset` Vector3 read/write `TargetPoint` Vector3 read `RigType` number read `FloorMaterial` number read `DisplayDistanceType` number read/write `HealthDisplayDistance` number read/write `HealthDisplayType` number read/write `NameDisplayDistance` number read/write `NameOcclusion` number read/write `DisplayName` string read `SeatPart` Instance read `HumanoidRootPart` Instance read Copy local char = game.local_player.character local hum = char:find_first_child("Humanoid") if hum then hum.walk_speed = 50 hum.jump_power = 100 hum.state = 6 -- Flying hum.auto_rotate = false hum.sit = false print("State: " .. hum.state_name) print("Speed: " .. hum.walk_speed) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#player-properties) Player properties Property Type Access `Character` Instance read `UserId` number read `DisplayName` string read `Team` Instance read `AccountAge` number read `CameraMode` number read/write `MaxZoomDistance` number read/write `MinZoomDistance` number read/write `HealthDisplayDistance` number read/write `NameDisplayDistance` number read/write Copy local lp = game.local_player print("Account age: " .. lp.account_age .. " days") lp.camera_mode = 1 -- LockFirstPerson lp.max_zoom_distance = 0.5 -- force first person #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#camera-properties) Camera properties Property Type Access `Position` / `CFrame` Vector3 read `FieldOfView` number read/write `LookVector` Vector3 read `CameraType` number read/write `CameraSubject` Instance read Copy local ws = game.workspace local cam = ws:find_first_child_of_class("Camera") if cam then print("FOV: " .. cam.field_of_view) print("Type: " .. cam.camera_type) cam.field_of_view = 90 cam.camera_type = 0 -- Custom end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#model-properties) Model properties Property Type Access `PrimaryPart` Instance read `Scale` number read #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#tool-properties) Tool properties Property Type Access `CanBeDropped` bool read/write `Enabled` bool read/write `ManualActivationOnly` bool read/write `RequiresHandle` bool read/write Copy local char = game.local_player.character local tool = char:find_first_child_of_class("Tool") if tool then tool.can_be_dropped = false tool.enabled = true print("Tool: " .. tool.name) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#sound-properties) Sound properties Property Type Access `Volume` number read/write `PlaybackSpeed` number read/write `Looped` bool read/write `Playing` bool read/write `RollOffMinDistance` number read/write `RollOffMaxDistance` number read/write Copy -- mute all sounds under workspace local sounds = game.workspace:get_descendants() for _, inst in ipairs(sounds) do if inst.class_name == "Sound" then inst.volume = 0 end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#proximityprompt-properties) ProximityPrompt properties Property Type Access `Enabled` bool read/write `MaxActivationDistance` number read/write `HoldDuration` number read/write `KeyCode` number read/write `RequiresLineOfSight` bool read/write Copy -- make all prompts instant and long range local descs = game.workspace:get_descendants() for _, inst in ipairs(descs) do if inst.class_name == "ProximityPrompt" then inst.hold_duration = 0 inst.max_activation_distance = 1000 inst.requires_line_of_sight = false end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#seat-properties) Seat properties Property Type Access `Occupant` Instance read #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#vehicleseat-properties) VehicleSeat properties Property Type Access `MaxSpeed` number read/write `Steer` number read `Throttle` number read `Torque` number read/write `TurnSpeed` number read/write Copy local seat = game.workspace:find_first_child("VehicleSeat", true) if seat then seat.max_speed = 200 seat.torque = 50000 print("Steer: " .. seat.steer) print("Throttle: " .. seat.throttle) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#screengui-properties) ScreenGui properties Property Type Access `Enabled` bool read/write #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#workspace-properties) Workspace properties Property Type Access `Gravity` number read/write `Terrain` Instance read `DistributedGameTime` number read #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#lighting-properties) Lighting properties Property Type Access `Brightness` number read/write `ExposureCompensation` number read/write `FogStart` number read/write `FogEnd` number read/write `EnvironmentDiffuseScale` number read/write `EnvironmentSpecularScale` number read/write `ClockTime` number read/write `GeographicLatitude` number read/write `GlobalShadows` bool read/write `Ambient` table {r,g,b,a} read/write `OutdoorAmbient` table {r,g,b,a} read/write `FogColor` table {r,g,b,a} read/write Copy local lit = game.lighting lit.clock_time = 12.0 -- set to noon lit.brightness = 2.0 lit.fog_start = 0 lit.fog_end = 1000 lit.global_shadows = false lit.geographic_latitude = 0 #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#terrain-properties) Terrain properties Property Type Access `GrassLength` number read/write `WaterTransparency` number read/write `WaterReflectance` number read/write `WaterWaveSize` number read/write `WaterWaveSpeed` number read/write `WaterColor` table {r,g,b,a} read/write #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#guiobject-properties) GuiObject properties Applies to Frame, TextLabel, TextButton, TextBox, ImageLabel, ImageButton, ScrollingFrame. Property Type Access `Visible` bool read `Rotation` number read `LayoutOrder` number read `Position` table read `Size` table read `BackgroundColor3` table {R,G,B} read #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#textlabel-textbutton-textbox-properties) TextLabel / TextButton / TextBox properties Property Type Access `Text` string read `RichText` bool read `TextColor3` table {R,G,B} read #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#value-properties) Value properties IntValue, NumberValue, BoolValue, StringValue, ObjectValue, Vector3Value, CFrameValue all support `Value` for both read and write. Copy local coins = game.replicated_storage:find_first_child("Coins") if coins then print("Coins: " .. coins.value) coins.value = 999 end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#humanoid-states) Humanoid States The `State` property uses a numeric enum. Use `StateName` for a readable string. Value Name 0 FallingDown 1 Ragdoll 2 GettingUp 3 Jumping 4 Swimming 5 Freefall 6 Flying 7 Landed 8 Running 10 RunningNoPhysics 11 StrafingNoPhysics 12 Climbing 13 Seated 14 PlatformStanding 15 Dead 16 Physics 18 None * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#vector3) Vector3 Copy local v = Vector3.new(x, y, z) Properties: `x`, `y`, `z`, `magnitude`, `unit` Methods: Copy v:dot(other) -- returns number v:cross(other) -- returns Vector3 v:lerp(other, t) -- returns Vector3 Operators: `+`, `-`, `*`, `/`, unary `-`, `==`, `#` (returns magnitude) Copy local a = Vector3.new(1, 0, 0) local b = Vector3.new(0, 1, 0) local c = a + b local d = a * 5 local len = #a * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#camera-api) camera API Copy local pos = camera.get_position() -- returns Vector3 local look = camera.get_look_vector() -- returns Vector3 local fov = camera.get_fov() -- returns number camera.set_fov(90) camera.look_at(target_vec3) -- snap camera to target camera.look_at(target_vec3, 10) -- smooth interpolation camera.look_at(x, y, z) -- raw numbers Example: draw a tracer line to each player: Copy function on_frame() local w, h = utility.get_screen_size() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local sx, sy, visible = draw.world_to_screen( p.head_position.x, p.head_position.y, p.head_position.z ) if visible then draw.line(w / 2, h, sx, sy, {1, 0.3, 0.3, 1}) end ::continue:: end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#input-api) input API Copy input.is_key_down(vk_code) -- returns boolean input.get_screen_center() -- returns x, y input.move_mouse(dx, dy) -- relative mouse movement in pixels `input.move_mouse` moves the cursor by `dx` pixels horizontally and `dy` pixels vertically relative to its current position. Uses SendInput with MOUSEEVENTF\_MOVE. Copy input.move_mouse(10, 0) -- move right 10px input.move_mouse(-5, -5) -- move up-left Example: aimbot step toward nearest player: Copy function on_frame() if not input.is_key_down(0x02) then return end local players = entity.get_players() local cx, cy = input.get_screen_center() local best_x, best_y = nil, nil local closest_dist = 150 for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local sx, sy, visible = draw.world_to_screen( p.head_position.x, p.head_position.y, p.head_position.z ) if not visible then goto continue end local dist = math.sqrt((sx - cx)^2 + (sy - cy)^2) if dist < closest_dist then closest_dist = dist best_x, best_y = sx, sy end ::continue:: end if best_x then local speed = 0.15 local dx = (best_x - cx) * speed local dy = (best_y - cy) * speed input.move_mouse(math.floor(dx), math.floor(dy)) end end Common VK codes: `0x01` (LMB), `0x02` (RMB), `0x04` (MMB), `0x10` (Shift), `0x11` (Ctrl), `0x12` (Alt), `0x20` (Space), `0x1B` (Escape) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#part-api) part API Directly writes game state to part properties via memory. These are method-style calls that take an instance as the first argument. Copy part.set_position(instance, x, y, z) part.set_size(instance, x, y, z) part.set_velocity(instance, x, y, z) part.set_angular_velocity(instance, x, y, z) part.set_transparency(instance, value) part.set_can_collide(instance, bool) part.set_anchored(instance, bool) part.set_can_query(instance, bool) part.set_can_touch(instance, bool) Copy local root = game.local_player.character:find_first_child("HumanoidRootPart") if root then part.set_velocity(root, 0, 100, 0) -- launch upward part.set_anchored(root, true) -- freeze in place part.set_can_collide(root, false) -- noclip end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#utility-instance-api) utility (instance) API Copy utility.is_valid(instance) -- returns boolean utility.clear_cache() -- clears internal name/class caches utility.invalidate_instance(instance) -- removes one instance from cache Use `utility.is_valid` before reading from instances you obtained several frames ago. Copy function on_frame() local inst = get_some_instance() if not utility.is_valid(inst) then return end print(inst.name) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#examples) Examples #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#noclip) Noclip Copy function on_frame() if not input.is_key_down(0x11) then return end -- hold Ctrl local char = game.local_player.character if not char then return end local parts = char:get_children() for _, p in ipairs(parts) do if p:is_a("BasePart") then p.can_collide = false end end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#speed-hack-with-anti-cheat-mirror) Speed hack with anti-cheat mirror Copy local char = game.local_player.character local hum = char:find_first_child("Humanoid") if hum then local speed = 100 hum.walk_speed = speed hum.walkspeed_check = speed -- mirror for anti-cheat end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#force-fly-state) Force fly state Copy local char = game.local_player.character local hum = char:find_first_child("Humanoid") if hum then hum.state = 6 -- Flying print("Now flying: " .. hum.state_name) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#disable-all-proximity-prompts) Disable all proximity prompts Copy local descs = game.workspace:get_descendants() for _, inst in ipairs(descs) do if inst.class_name == "ProximityPrompt" then inst.enabled = false end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#fullbright) Fullbright Copy local lit = game.lighting lit.brightness = 2 lit.clock_time = 14 lit.fog_end = 100000 lit.global_shadows = false lit.ambient = {1, 1, 1} lit.outdoor_ambient = {1, 1, 1} #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#mute-game-audio) Mute game audio Copy local descs = game.workspace:get_descendants() for _, inst in ipairs(descs) do if inst.class_name == "Sound" then inst.volume = 0 inst.playing = false end end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#lock-first-person) Lock first person Copy local lp = game.local_player lp.camera_mode = 1 lp.min_zoom_distance = 0.5 lp.max_zoom_distance = 0.5 #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#teleport-to-position) Teleport to position Copy local root = game.local_player.character:find_first_child("HumanoidRootPart") if root then root.position = Vector3.new(0, 100, 0) end #### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#walk-through-walls-disable-collision-on-all-parts-in-character) Walk through walls (disable collision on all parts in character) Copy function on_frame() local char = game.local_player.character if not char then return end for _, child in ipairs(char:get_children()) do if child:is_a("BasePart") then child.can_collide = false child.can_query = false end end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api#api-reference) API Reference Function Returns Description `game.workspace` Instance Workspace service `game.players` Instance Players service `game.lighting` Instance Lighting service `game.local_player` Instance Local player `game.place_id` number Current place ID `game.game_id` number Current game ID `game.get_service(name)` Instance Get any service by name `camera.get_position()` Vector3 Camera world position `camera.get_look_vector()` Vector3 Camera forward direction `camera.get_fov()` number Current field of view `camera.set_fov(value)` bool Set field of view `camera.look_at(target, smooth?)` bool Point camera at target `input.is_key_down(vk)` bool Check if key is held `input.get_screen_center()` x, y Screen center coordinates `input.move_mouse(dx, dy)` \- Relative mouse movement `part.set_position(inst, x, y, z)` \- Set part position `part.set_size(inst, x, y, z)` \- Set part size `part.set_velocity(inst, x, y, z)` \- Set linear velocity `part.set_angular_velocity(inst, x, y, z)` \- Set angular velocity `part.set_transparency(inst, v)` \- Set transparency `part.set_can_collide(inst, b)` \- Set collision `part.set_anchored(inst, b)` \- Set anchored `part.set_can_query(inst, b)` \- Set raycast queryable `part.set_can_touch(inst, b)` \- Set touch events `utility.is_valid(inst)` bool Check instance validity `utility.clear_cache()` bool Clear all caches `utility.invalidate_instance(inst)` \- Clear one from cache [PreviousThread APIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api) [NextMenu APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api) Last updated 5 days ago --- # Thread API | Vector Lua Engine The thread API lets you run callbacks on a background timer, independent of the render loop. Use it for periodic monitoring, data collection, or any task that doesn't need to run every frame. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. Pick one and stay consistent in your scripts. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#thread.create) thread.create Copy local id = thread.create(callback, interval_ms) Parameter Type Required Description `callback` function yes Function to call repeatedly `interval_ms` number no Interval in milliseconds. Default: 100. Minimum: 1 Returns a `thread_id` number used to control the thread later. Copy local my_thread = thread.create(function() print("tick") end, 500) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#thread.stop) thread.stop Copy thread.stop(thread_id) Stops a specific thread and releases its callback. Copy thread.stop(my_thread) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#thread.stop_all) thread.stop\_all Copy thread.stop_all() Stops every running thread at once. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#thread.is_running) thread.is\_running Copy local running = thread.is_running(thread_id) Returns `true` if the thread is still active. Copy if thread.is_running(my_thread) then print("still running") end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#thread.set_interval) thread.set\_interval Copy thread.set_interval(thread_id, new_interval_ms) Changes the interval of a running thread without stopping it. Copy thread.set_interval(my_thread, 200) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#examples) Examples **Background health monitor — create once, runs forever:** Copy local health_thread = nil function on_frame() if health_thread ~= nil then return end health_thread = thread.create(function() local players = entity.get_players() for _, p in ipairs(players) do print(p.name .. " hp: " .. p.health) end end, 1000) end **Multiple threads at different rates:** Copy local threads = {} function on_frame() if #threads > 0 then return end -- fast cache refresh threads[1] = thread.create(function() print("cache update") end, 200) -- slow status log threads[2] = thread.create(function() print("status check") end, 5000) end **Toggle thread on/off with a key:** Copy local monitor = nil function on_frame() if input.is_key_down(0x4D) then -- M key if monitor == nil then monitor = thread.create(function() print("monitoring...") end, 1000) else thread.stop(monitor) monitor = nil end end end **Lifecycle — create, check, adjust, stop:** Copy local my_thread = thread.create(function() print("working") end, 1000) if thread.is_running(my_thread) then thread.set_interval(my_thread, 500) end thread.stop(my_thread) -- or stop everything at once thread.stop_all() * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#notes) Notes * Never call `thread.create` unconditionally inside `on_frame` — it runs every frame and will spawn thousands of threads. Guard with a nil check. * Use threads for monitoring and background work. Use `on_frame` for all rendering and real-time input. * Threads share the Lua state and can read globals written by `on_frame`. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#api-reference) API Reference Function Returns Description `thread.create(fn, ms)` number Create thread, returns ID `thread.stop(id)` — Stop specific thread `thread.stop_all()` — Stop all threads `thread.is_running(id)` boolean Check if thread is active `thread.set_interval(id, ms)` — Change thread interval * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/thread-api#interval-guidelines) Interval Guidelines Interval Use Case 100–200ms Frequent updates 500–1000ms Regular monitoring 2000–5000ms Periodic tasks 5000ms+ Infrequent checks Use `on_frame` for rendering and real-time input. Use threads for everything else. [PreviousNavigating The UIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/introduction/navigating-the-ui) [NextGame APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api) Last updated 5 days ago --- # Utility API | Vector Lua Engine [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility-api) Utility API ------------------------------------------------------------------------------------------------------------- General-purpose utilities for screen projection, frame timing, cursor position, FPS, key events, input simulation, and HTTP. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. Pick one and stay consistent in your scripts. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.world_to_screen) utility.world\_to\_screen Copy local sx, sy, on_screen = utility.world_to_screen(x, y, z) -- also accepts a Vector3 local sx, sy, on_screen = utility.world_to_screen(vec3) Projects a 3D world position to 2D screen coordinates using the current view matrix. Unlike `draw.world_to_screen`, this version returns `on_screen = true` only when the projected point falls inside the screen bounds — not just in front of the camera. Copy local sx, sy, on_screen = utility.world_to_screen(100, 5, 200) if on_screen then draw.circle_filled(sx, sy, 4, {0, 1, 0, 1}) end Copy local v = Vector3.new(100, 5, 200) local sx, sy, on_screen = utility.world_to_screen(v) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.get_screen_size) utility.get\_screen\_size Copy local w, h = utility.get_screen_size() Returns the current render resolution in pixels. Copy local w, h = utility.get_screen_size() local cx, cy = w / 2, h / 2 * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.get_mouse_pos) utility.get\_mouse\_pos Copy local mx, my = utility.get_mouse_pos() Returns the current cursor position in screen space using `GetCursorPos`. Copy function on_frame() local mx, my = utility.get_mouse_pos() draw.text(mx + 12, my, "cursor", {1, 1, 1, 1}) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.get_delta_time) utility.get\_delta\_time Copy local dt = utility.get_delta_time() Returns seconds elapsed since the last frame, clamped to \[0.0001, 0.1\]. Use this to make any movement or animation frame-rate independent: Copy local x = 0 local speed = 200 -- pixels per second function on_frame() local dt = utility.get_delta_time() x = x + speed * dt local w, h = utility.get_screen_size() if x > w then x = 0 end draw.circle_filled(x, 100, 5, {0, 1, 1, 1}) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.get_time) utility.get\_time Copy local seconds = utility.get_time() Returns seconds elapsed since the engine started as a high-precision float. Uses `steady_clock` so the value is monotonic and never jumps. Useful for timed logic, cooldowns, and animation timing without dealing with millisecond conversions. Copy local last_check = 0 function on_frame() local now = utility.get_time() if now - last_check < 1.0 then return end last_check = now print("one second passed") end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.get_tick_count) utility.get\_tick\_count Copy local ms = utility.get_tick_count() Returns `GetTickCount64()` — milliseconds elapsed since system boot. Useful for cooldowns and timed logic. Copy local last_action = 0 local cooldown_ms = 500 function on_frame() local now = utility.get_tick_count() if input.is_key_down(0x46) then -- F key if now - last_action > cooldown_ms then print("action fired") last_action = now end end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.get_fps) utility.get\_fps Copy local fps = utility.get_fps() Returns a smoothed FPS value averaged over the last 60 frames. Copy function on_frame() local fps = utility.get_fps() draw.text(10, 10, "FPS: " .. math.floor(fps), {0.6, 1, 0.6, 1}) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.is_valid) utility.is\_valid Copy local valid = utility.is_valid(instance) Returns `true` if the given instance userdata still points to a valid Roblox object in memory. Checks the class descriptor, name pointer, and parent to confirm the object has not been destroyed or garbage collected. Use this before accessing properties on instances that may have been removed from the game tree. Copy local char = player.character if utility.is_valid(char) then local pos = char.Position print(pos.x, pos.y, pos.z) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.on_key) utility.on\_key Copy local id = utility.on_key(vk_code, mode, callback) Registers a key binding that fires automatically every frame — no manual `input.is_key_down` polling needed. Returns a numeric `id` you can pass to `utility.remove_key` to unregister later. **Modes:** Copy -- Toggle an ESP feature on/off with F local esp_on = false local esp_id = utility.on_key(0x46, "toggle", function(state) esp_on = state print("ESP: " .. (state and "ON" or "OFF")) end) -- React to hold/release of G utility.on_key(0x47, "hold", function(state) if state then print("G held — activating") else print("G released") end end) -- Draw an indicator every frame while RMB is held utility.on_key(0x02, "always", function(state) if state then draw.text(10, 10, "ADS ACTIVE", {0, 1, 0, 1}, 14) end end) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.remove_key) utility.remove\_key Copy utility.remove_key(id) Unregisters one binding by the `id` returned from `utility.on_key`. Copy local my_id = utility.on_key(0x46, "toggle", function(state) end) -- later... utility.remove_key(my_id) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.clear_keys) utility.clear\_keys Copy utility.clear_keys() Removes all registered key bindings at once. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.is_key_toggled) utility.is\_key\_toggled Copy local state = utility.is_key_toggled(id) Returns the current toggle state (`true`/`false`) for a `"toggle"` mode binding. Returns `false` for other modes or an unknown id. Copy local id = utility.on_key(0x46, "toggle", function(state) end) function on_frame() if utility.is_key_toggled(id) then draw.text(10, 10, "FEATURE ON", {0, 1, 0, 1}, 14) end end * * * > **Important:** All input simulation functions send real OS-level input via `SendInput`. While the menu is open it captures input focus, so simulated clicks and key presses will be absorbed by the overlay instead of reaching the game. Close the menu before using these functions. In practice this means input simulation should run inside `on_frame` guarded by a toggle key or condition, not as a one-shot at script load time. ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.mouse_click) utility.mouse\_click Copy utility.mouse_click(button?, x?, y?) Simulates a full mouse click (down + up) via `SendInput`. Sends real input events that the game receives as genuine clicks. * `button` — `"left"` (default), `"right"`, or `"middle"` * `x, y` — optional screen coordinates to move the cursor to before clicking Copy -- left click at current cursor position utility.mouse_click() -- right click at a specific screen position utility.mouse_click("right", 500, 300) -- middle click utility.mouse_click("middle") * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.mouse_move) utility.mouse\_move Copy utility.mouse_move(x, y, absolute?) Moves the mouse cursor via `SendInput`. By default the movement is relative (pixels from current position). Pass `true` as the third argument for absolute screen coordinates. Copy -- move 10 pixels right, 5 pixels down from current position utility.mouse_move(10, 5) -- move cursor to absolute screen position utility.mouse_move(960, 540, true) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.mouse_scroll) utility.mouse\_scroll Copy utility.mouse_scroll(amount) Simulates a mouse scroll wheel event. Positive values scroll up, negative values scroll down. One unit equals one "click" of the scroll wheel. Copy -- scroll up 3 clicks utility.mouse_scroll(3) -- scroll down 1 click utility.mouse_scroll(-1) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.key_press) utility.key\_press Copy utility.key_press(vk_code, hold_ms?) Simulates a full key press — sends key down, holds for `hold_ms` milliseconds (default `30`, about 2 frames at 60fps), then sends key up. The overlay stays responsive during the hold. Uses Windows virtual key codes. Copy -- press the spacebar (held for 30ms by default) utility.key_press(0x20) -- press W and hold for 200ms before releasing utility.key_press(0x57, 200) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.key_down) utility.key\_down Copy utility.key_down(vk_code) Sends a key down event only. The key stays held until you call `utility.key_up` with the same key code. Copy -- hold W down utility.key_down(0x57) -- ... later ... utility.key_up(0x57) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.key_up) utility.key\_up Copy utility.key_up(vk_code) Sends a key up event only. Use after `utility.key_down` to release a held key. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.type_string) utility.type\_string Copy utility.type_string(text, delay_ms?) Types a string character by character using unicode input events. Works with any character including special symbols and non-ASCII text. Each character sends a down + up event with a small delay between characters so the target application registers each one. * `delay_ms` — milliseconds between each character (default `5`). Set higher if characters are being dropped. Copy -- type into a chat box or text field utility.type_string("hello world") -- slower typing for applications that need more time utility.type_string("gg ez", 15) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.http_get) utility.http\_get Copy local body, status = utility.http_get(url) -- on failure: -- body == nil, status == error string Performs an HTTP/HTTPS GET and returns the response body as a string plus the HTTP status code. The UI stays responsive during the request — the Lua mutex is released while the network call is in progress. Copy local body, status = utility.http_get("https://pastebin.com/raw/AbCdEfGh") if body and status == 200 then local fn, err = loadstring(body) if fn then fn() else print("compile error: " .. err) end else print("fetch failed: " .. tostring(status)) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#utility.load_url) utility.load\_url Copy local ok, err = utility.load_url(url) Fetches Lua source from a URL and executes it in the current state. Equivalent to `loadstring(http_get(url))()` with full error handling. Globals and functions defined in the remote script are immediately available after this returns. Returns `true` on success, or `false, error_message` on network failure, non-200 status, compile error, or runtime error. Copy -- One-liner — load and run a remote script utility.load_url("https://pastebin.com/raw/AbCdEfGh") -- With error handling local ok, err = utility.load_url("https://pastebin.com/raw/AbCdEfGh") if not ok then print("load_url failed: " .. tostring(err)) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#examples) Examples HUD overlay — delta time animation + FPS counter: Copy local angle = 0 function on_frame() local dt = utility.get_delta_time() local fps = utility.get_fps() local w, h = utility.get_screen_size() angle = angle + dt * 90 if angle > 360 then angle = angle - 360 end local r = 40 local cx, cy = 60, h - 60 local rad = math.rad(angle) local px = cx + math.cos(rad) * r local py = cy + math.sin(rad) * r draw.circle(cx, cy, r, {1, 1, 1, 0.2}) draw.circle_filled(px, py, 5, {0, 1, 1, 1}) draw.text(10, 10, "FPS: " .. math.floor(fps), {0.6, 1, 0.6, 1}) end Distance-based ESP with world\_to\_screen: Copy function on_frame() local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local me = entity.get_local_player() if not me then goto continue end local dx = p.position.x - me.position.x local dy = p.position.y - me.position.y local dz = p.position.z - me.position.z local dist = math.sqrt(dx*dx + dy*dy + dz*dz) if dist > 500 then goto continue end local sx, sy, on_screen = utility.world_to_screen( p.head_position.x, p.head_position.y, p.head_position.z ) if on_screen then local label = p.name .. " [" .. math.floor(dist) .. "m]" draw.text(sx, sy - 16, label, {1, 1, 1, 1}) end ::continue:: end end Toggle ESP with F key: Copy local esp_on = false utility.on_key(0x46, "toggle", function(state) esp_on = state print("ESP: " .. (state and "ON" or "OFF")) end) function on_frame() if not esp_on then return end for _, p in ipairs(entity.get_players()) do if p.is_local or not p.is_alive then goto continue end local b = p:get_bounds() if b.valid then draw.box(b.x, b.y, b.w, b.h, {1, 1, 1, 1}) end ::continue:: end end Auto-jump with input simulation — toggle with H key, only runs while menu is closed: Copy local jumping = false utility.on_key(0x48, "toggle", function(state) jumping = state print("Auto-jump: " .. (state and "ON" or "OFF")) end) function on_frame() if not jumping then return end local me = entity.get_local_player() if not me or not me.is_alive then return end local now = utility.get_time() if not _last_jump or now - _last_jump > 2.0 then utility.key_press(0x20) _last_jump = now end end Automated typing into chat — triggered by pressing F9: Copy utility.on_key(0x78, "hold", function(state) if not state then return end -- press / to open chat, hold for 100ms so the chat box opens utility.key_press(0xBF, 100) -- type the message with 10ms between each character utility.type_string("gg", 10) -- press Enter to send, hold briefly so it registers utility.key_press(0x0D, 50) end) Hold W to walk forward while X is held: Copy utility.on_key(0x58, "hold", function(state) if state then utility.key_down(0x57) -- hold W else utility.key_up(0x57) -- release W end end) Load a remote script on startup: Copy local ok, err = utility.load_url("https://pastebin.com/raw/AbCdEfGh") if not ok then print("load_url failed: " .. tostring(err)) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/utility-api#api-reference) API Reference Function Description `utility.world_to_screen(x, y, z)` Project world position to screen `utility.get_screen_size()` Get render resolution `utility.get_mouse_pos()` Get cursor position `utility.get_delta_time()` Seconds since last frame `utility.get_time()` Seconds since engine start `utility.get_tick_count()` System uptime in milliseconds `utility.get_fps()` Smoothed FPS value `utility.is_valid(instance)` Check if instance is still valid `utility.on_key(vk, mode, fn)` Register a key binding `utility.remove_key(id)` Remove a key binding `utility.clear_keys()` Remove all key bindings `utility.is_key_toggled(id)` Get toggle state of a binding `utility.mouse_click(btn?, x?, y?)` Simulate a mouse click `utility.mouse_move(x, y, abs?)` Move the cursor `utility.mouse_scroll(amount)` Simulate scroll wheel `utility.key_press(vk, ms?)` Press and release a key (instant or held) `utility.key_down(vk)` Hold a key down `utility.key_up(vk)` Release a held key `utility.type_string(text, ms?)` Type a string character by character `utility.http_get(url)` HTTP GET request `utility.load_url(url)` Fetch and execute remote Lua [PreviousDraw APIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/api/draw-api) [NextRaycast APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api) Last updated 5 days ago --- # Menu API | Vector Lua Engine The menu API lets scripts add UI elements to the cheat menu. All elements are identified by a string `id` that you use to read and write values later. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. Pick one and stay consistent in your scripts. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#setup-tabs-and-groups) Setup — tabs and groups Every element must live inside a tab and a group. Create them before adding elements: Copy menu.add_tab("Visuals", "V") -- name, icon letter menu.add_group("Visuals", "Players") -- tab name, group name All `add_*` functions take `tab` and `group` as the first two arguments. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_checkbox) menu.add\_checkbox Copy menu.add_checkbox(tab, group, id, label, default, options) Parameter Type Required Description `tab` string yes Tab name `group` string yes Group name `id` string yes Unique element ID `label` string yes Display label `default` boolean yes Default value `options` table no Optional settings (see below) **Options table:** Key Type Description `key` number Attach a hotkey (VK code) `colorpicker` table `{r,g,b,a}` Attach an inline colorpicker `color` table `{r,g,b,a}` Attach a color swatch `parent` string Element ID to use as a visibility parent `show_mode` boolean Show hotkey mode selector Copy -- basic menu.add_checkbox("Visuals", "Players", "esp_on", "Enable ESP", false) -- with hotkey and colorpicker menu.add_checkbox("Visuals", "Players", "esp_on", "Enable ESP", false, { key = 0x2E, colorpicker = {1, 1, 1, 1}, }) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_slider_int) menu.add\_slider\_int Copy menu.add_slider_int(tab, group, id, label, min, max, default, options) Copy menu.add_slider_int("Visuals", "Players", "fov_size", "FOV Size", 10, 300, 90) -- with format string menu.add_slider_int("Visuals", "Players", "fov_size", "FOV Size", 10, 300, 90, "%dpx") -- with parent menu.add_slider_int("Visuals", "Players", "fov_size", "FOV Size", 10, 300, 90, { parent = "aimbot_on" }) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_slider_float) menu.add\_slider\_float Copy menu.add_slider_float(tab, group, id, label, min, max, default, options) Copy menu.add_slider_float("Aimbot", "Settings", "smooth", "Smooth", 0.0, 1.0, 0.15) -- with format string and parent menu.add_slider_float("Aimbot", "Settings", "smooth", "Smooth", 0.0, 1.0, 0.15, "%.2f", { parent = "aimbot_on" }) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_combo) menu.add\_combo Copy menu.add_combo(tab, group, id, label, items, default_index, options) Returns the selected item as a zero-based index. Copy menu.add_combo("Visuals", "Players", "box_style", "Box Style", {"Normal", "Corner", "Filled"}, 0) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_multicombo) menu.add\_multicombo Copy menu.add_multicombo(tab, group, id, label, items, defaults) Returns a table of booleans, one per item. Copy menu.add_multicombo("Visuals", "Players", "bone_list", "Bones", {"Head", "Torso", "Arms", "Legs"}, {true, true, false, false}) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_button) menu.add\_button Copy menu.add_button(tab, group, id, label, callback) Copy menu.add_button("Config", "Actions", "reload_btn", "Reload Config", function() print("reloading...") end) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_colorpicker) menu.add\_colorpicker Copy menu.add_colorpicker(tab, group, id, label, default_rgba, options) Copy menu.add_colorpicker("Visuals", "Players", "esp_color", "ESP Color", {1, 1, 1, 1}) -- with parent menu.add_colorpicker("Visuals", "Players", "esp_color", "ESP Color", {1, 1, 1, 1}, { parent = "esp_on" }) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_hotkey) menu.add\_hotkey Copy menu.add_hotkey(tab, group, id, label, default_key, options) Copy menu.add_hotkey("Aimbot", "Settings", "aim_key", "Aimbot Key", 0x02) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_input) menu.add\_input Copy menu.add_input(tab, group, id, label, default_text) Copy menu.add_input("Config", "General", "prefix", "Chat Prefix", "[VEC]") * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_label) menu.add\_label Copy menu.add_label(tab, group, text) Renders a dimmed text label. No ID required. Copy menu.add_label("Visuals", "Players", "Colors are in RGBA 0-1 range") * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#menu.add_separator) menu.add\_separator Copy menu.add_separator(tab, group) Inserts a vertical spacer between elements. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#reading-values) Reading values Copy local enabled = menu.get("esp_on") -- boolean local fov = menu.get("fov_size") -- number (int) local smooth = menu.get("smooth") -- number (float) local style = menu.get("box_style") -- number (zero-based index) local bones = menu.get("bone_list") -- table of booleans local text = menu.get("prefix") -- string local color = menu.get_color("esp_color") -- {r, g, b, a} local key = menu.get_key("aim_key") -- number (VK code) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#writing-values) Writing values Copy menu.set("esp_on", true) menu.set("fov_size", 120) menu.set("smooth", 0.2) menu.set("box_style", 1) menu.set_color("esp_color", {0, 1, 0.8, 1}) menu.set_key("aim_key", 0x02) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#callbacks) Callbacks Called whenever the user changes the value of an element. Copy menu.set_callback("fov_size", function(new_value) print("fov changed to: " .. new_value) end) menu.set_callback("esp_on", function(new_value) print("esp is now: " .. tostring(new_value)) end) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#visibility) Visibility Copy menu.set_visible("fov_size", false) menu.set_visible("fov_size", true) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#parent-conditional-visibility) Parent (conditional visibility) Attach elements to a checkbox — they only render when the checkbox is enabled: Copy menu.add_checkbox("Aimbot", "Settings", "aimbot_on", "Enable Aimbot", false) menu.add_slider_float("Aimbot", "Settings", "smooth", "Smooth", 0.0, 1.0, 0.15, { parent = "aimbot_on" }) menu.add_slider_int("Aimbot", "Settings", "fov", "FOV", 10, 300, 90, { parent = "aimbot_on" }) menu.add_hotkey("Aimbot", "Settings", "aim_key", "Key", 0x02, { parent = "aimbot_on" }) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#full-setup-example) Full setup example Copy -- tabs and groups menu.add_tab("Visuals", "V") menu.add_group("Visuals", "ESP") menu.add_tab("Aimbot", "A") menu.add_group("Aimbot", "Settings") -- visuals menu.add_checkbox("Visuals", "ESP", "esp_on", "Enable ESP", false) menu.add_checkbox("Visuals", "ESP", "esp_names", "Names", true, { parent = "esp_on" }) menu.add_checkbox("Visuals", "ESP", "esp_boxes", "Boxes", true, { parent = "esp_on" }) menu.add_combo("Visuals", "ESP", "box_style", "Box Style", {"Normal", "Corner"}, 0) menu.add_colorpicker("Visuals", "ESP", "esp_col", "Color", {1, 1, 1, 1}) menu.add_slider_float("Visuals", "ESP", "esp_dist", "Max Dist", 0, 500, 200, { parent = "esp_on" }) -- aimbot menu.add_checkbox("Aimbot", "Settings", "aimbot_on", "Enable Aimbot", false) menu.add_slider_float("Aimbot", "Settings", "smooth", "Smooth", 0.0, 1.0, 0.15, { parent = "aimbot_on" }) menu.add_slider_int("Aimbot", "Settings", "fov", "FOV", 10, 300, 90, { parent = "aimbot_on" }) menu.add_hotkey("Aimbot", "Settings", "aim_key", "Key", 0x02) -- on_frame usage function on_frame() if not menu.get("esp_on") then return end local color = menu.get_color("esp_col") local style = menu.get("box_style") local players = entity.get_players() for _, p in ipairs(players) do if p.is_local or not p.is_alive then goto continue end local b = p:get_bounds() if not b.valid then goto continue end draw.box(b.x, b.y, b.w, b.h, color, 0, style) if menu.get("esp_names") then local tw, th = draw.get_text_size(p.name, 14) draw.text(b.x + b.w / 2 - tw / 2, b.y - th - 2, p.name, {1, 1, 1, 1}) end ::continue:: end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/menu-api#api-reference) API Reference Function Returns Description `menu.add_tab(name, icon)` — Register a tab `menu.add_group(tab, name)` — Register a group inside a tab `menu.add_checkbox(...)` — Add a checkbox `menu.add_slider_int(...)` — Add an integer slider `menu.add_slider_float(...)` — Add a float slider `menu.add_combo(...)` — Add a dropdown `menu.add_multicombo(...)` — Add a multi-select dropdown `menu.add_button(...)` — Add a button `menu.add_colorpicker(...)` — Add a color picker `menu.add_hotkey(...)` — Add a key bind widget `menu.add_input(...)` — Add a text input `menu.add_label(...)` — Add a text label `menu.add_separator(...)` — Add a spacer `menu.get(id)` any Read element value `menu.get_color(id)` table Read color value `menu.get_key(id)` number Read key value `menu.set(id, value)` — Write element value `menu.set_color(id, rgba)` — Write color value `menu.set_key(id, vk)` — Write key value `menu.set_callback(id, fn)` — Set on-change callback `menu.set_visible(id, bool)` — Show or hide element [PreviousGame APIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/api/game-api) [NextEntity APIchevron-right](https://project-vector-1.gitbook.io/vector-lua-engine/api/entity-api) Last updated 5 days ago --- # FFlag API | Vector Lua Engine The fflag API gives scripts direct read and write access to Roblox's Fast Flag (FFlag) system. A background thread scans the game's memory for all registered FFlags and caches their names, addresses, and values. The Lua API reads and writes through that cache with no render-thread cost. > All examples use `snake_case`. Every function is also accessible in `camelCase` and `PascalCase` — the engine accepts all three. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#how-it-works) How it works The fflag system runs on a dedicated worker thread: * **FFlags** are discovered by pattern scanning the Roblox binary for flag registration stubs. Each stub contains a pointer to the flag's DWORD value and a string pointer to its name. * **Deduplication** removes flags that appear at multiple addresses, preferring the one inside the main module over heap copies. * **A watch loop** polls flag values every 100ms and publishes updated snapshots via a lock-free shared pointer, so Lua reads are always safe and never block. `fflag.is_scanned()` returns `false` while the initial scan is still running. All read functions return `nil` or empty tables until the scan completes. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.is_scanned) fflag.is\_scanned Copy local ready = fflag.is_scanned() Returns `true` once the fflag cache has completed its initial pattern scan. Use this as a guard before accessing flags. Copy function on_frame() if not fflag.is_scanned() then draw.text(10, 10, "scanning fflags...", {1, 1, 0, 1}) return end draw.text(10, 10, "flags loaded: " .. fflag.get_count(), {0, 1, 0, 1}) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.get_count) fflag.get\_count Copy local count = fflag.get_count() Returns the total number of FFlags currently cached. Typically around 6000–7000 depending on the Roblox version. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.get_value) fflag.get\_value Copy local value = fflag.get_value(flag_name) Returns the current integer value of a flag by its exact name, or `nil` if the flag was not found. Parameter: the full flag name as a string. Names are case-sensitive and must match exactly as they appear in Roblox's internal registry. Returns `nil` if the flag does not exist or the cache is not yet scanned. Copy local fps_cap = fflag.get_value("TaskSchedulerTargetFps") if fps_cap then print("current fps cap: " .. fps_cap) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.set_value) fflag.set\_value Copy local success = fflag.set_value(flag_name, value) Writes a new integer value to a flag. Returns `true` if the flag was found and written, `false` otherwise. The write goes directly to the flag's memory address in the Roblox process. The change takes effect immediately. Copy -- unlock fps fflag.set_value("TaskSchedulerTargetFps", 9999) -- enable debug fps display fflag.set_value("DebugDisplayFPS", 1) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.reset_value) fflag.reset\_value Copy local success = fflag.reset_value(flag_name) Resets a single flag to its original value (the value it had when first scanned). Returns `true` if the flag was found and reset, `false` otherwise. Copy fflag.set_value("TaskSchedulerTargetFps", 9999) -- later... fflag.reset_value("TaskSchedulerTargetFps") * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.reset_all) fflag.reset\_all Copy fflag.reset_all() Resets all modified flags back to their original values. Takes no arguments and returns nothing. Useful for cleanup when unloading a script. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.find) fflag.find Copy local results = fflag.find(pattern) Searches all cached flags for names containing the given substring. The search is case-insensitive. Returns a table of matching flags, each with the following fields: * `name` — the full flag name (string) * `value` — current integer value (number) * `original` — the value when first scanned (number) * `changed` — whether the value differs from the original (boolean) * `index` — the flag's position in the cache (number) Copy local physics_flags = fflag.find("physics") for _, flag in ipairs(physics_flags) do local status = flag.changed and " [MODIFIED]" or "" print(flag.name .. " = " .. flag.value .. status) end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#fflag.get_all) fflag.get\_all Copy local all = fflag.get_all() Returns a table containing every cached flag. Each entry has the same fields as `fflag.find` plus an `address` field containing the flag's memory address. This can return a large table (6000+ entries). Prefer `fflag.find()` for targeted lookups. Copy local all = fflag.get_all() local modified = 0 for _, flag in ipairs(all) do if flag.changed then modified = modified + 1 print(flag.name .. ": " .. flag.original .. " -> " .. flag.value) end end print("total modified: " .. modified) * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#examples) Examples FPS unlocker — set the task scheduler target every frame in case the game resets it: Copy function on_frame() if not fflag.is_scanned() then return end local current = fflag.get_value("TaskSchedulerTargetFps") if current and current ~= 9999 then fflag.set_value("TaskSchedulerTargetFps", 9999) print("fps unlocked") end end Search and display flags on screen: Copy function on_frame() if not fflag.is_scanned() then return end local render_flags = fflag.find("render") local y = 30 draw.text(10, 10, "Render Flags: " .. #render_flags, {1, 1, 1, 1}) for i, flag in ipairs(render_flags) do if i > 15 then break end local color = flag.changed and {1, 0.5, 0, 1} or {0.7, 0.7, 0.7, 1} draw.text(10, y, flag.name .. " = " .. flag.value, color) y = y + 16 end end Bulk modification with cleanup on script unload: Copy local modified_flags = {} function apply_tweaks() local tweaks = { {"TaskSchedulerTargetFps", 9999}, {"DebugDisplayFPS", 1}, } for _, tweak in ipairs(tweaks) do local name, value = tweak[1], tweak[2] local old = fflag.get_value(name) if old then fflag.set_value(name, value) table.insert(modified_flags, name) print("set " .. name .. ": " .. old .. " -> " .. value) end end end function cleanup() for _, name in ipairs(modified_flags) do fflag.reset_value(name) end modified_flags = {} print("all tweaks reverted") end function on_frame() if not fflag.is_scanned() then return end if #modified_flags == 0 then apply_tweaks() end end Monitor all modified flags in real time: Copy local last_check = 0 function on_frame() if not fflag.is_scanned() then return end local now = utility.get_time() if now - last_check < 1.0 then return end last_check = now local all = fflag.get_all() local changed = {} for _, flag in ipairs(all) do if flag.changed then table.insert(changed, flag) end end if #changed > 0 then draw.text(10, 10, "Modified Flags: " .. #changed, {1, 0.5, 0, 1}) local y = 30 for _, flag in ipairs(changed) do draw.text(10, y, flag.name .. ": " .. flag.original .. " -> " .. flag.value, {1, 0.8, 0.3, 1}) y = y + 16 end end end * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#performance-notes) Performance notes * All read functions (`get_value`, `find`, `get_all`) read from an atomic shared pointer snapshot. They never block the render thread or the fflag worker thread. * `set_value` and `reset_value` perform a single memory write to the Roblox process per call. They are safe to call every frame but there is no benefit to doing so since the value persists until changed. * The watch loop detects external changes to flag values every 100ms. If the game resets a flag you modified, you will see the change reflected in the next snapshot. * Flag values are 32-bit integers (DWORD). Flags that appear as booleans in Roblox use `0` for false and `1` for true. * The flag cache rebuilds when the game teleports to a new place. Modified values are not preserved across teleports. * `get_all` returns a large table. Avoid calling it every frame. Use `find` for targeted lookups or cache results in a local variable. * * * ### [hashtag](https://project-vector-1.gitbook.io/vector-lua-engine/api/fflag-api#api-reference) API Reference Function Description `fflag.is_scanned()` Returns `true` when the flag cache is ready `fflag.get_count()` Returns total number of cached flags `fflag.get_value(name)` Read a flag's current value by name `fflag.set_value(name, value)` Write a new integer value to a flag `fflag.reset_value(name)` Reset a flag to its original value `fflag.reset_all()` Reset all flags to original values `fflag.find(pattern)` Case-insensitive substring search `fflag.get_all()` Get all flags as a table [PreviousRaycast APIchevron-left](https://project-vector-1.gitbook.io/vector-lua-engine/api/raycast-api) Last updated 5 days ago ---