Creed Lua Scripting API
Create custom overlays, radars, ESP, HUDs, and game tools using the built-in Lua scripting engine. Scripts run each frame and can read live game data and draw to the overlay.
Overview
The Creed team is proud to introduce the Creed Scripting Engine, powered by a built-in Lua 5.4 runtime. Each .lua file in the scripts/ or scripts/examples/ folder is loaded automatically at startup. Scripts can be toggled on/off, reloaded live, and each runs in its own isolated Lua state.
All scripting happens through the global creed table, which provides:
- Drawing — lines, boxes, circles, triangles, and text rendered on the overlay
- Game data — entities, projectiles, player stats, camera, artillery, wind
- Projection — WorldToScreen and WorldToRadar for coordinate conversion
- Utilities — timing, math helpers, logging
Quick Start
Create a .lua file in the scripts/ folder (or scripts/examples/) with a global OnTick() function:
-- hello.lua
local WHITE = creed.Color(255, 255, 255)
function OnTick()
creed.DrawText("Hello from Lua!", 100, 100, WHITE, 20.0)
end
That's it. The overlay picks it up automatically (or click Reload All in the Scripts tab).
.lua file, then hit Reload in the overlay.
Script Lifecycle
Each script goes through these stages:
- Load — The file is read and executed once (top-level code runs here). Use this for
localvariable initialization and color constants. - OnTick() — Called every frame (~60 times/second). All drawing and data queries go here.
- Reload — Triggered from the overlay UI. The script state is destroyed and re-created from disk.
-- Top-level: runs once on load
local counter = 0
local RED = creed.Color(255, 0, 0)
-- Called every frame
function OnTick()
counter = counter + 1
creed.DrawText("Frame: " .. tostring(counter), 10, 10, RED)
end
Sandbox & Safety
Scripts run in a sandboxed Lua environment. The following are not available for security:
| Blocked | Reason |
|---|---|
| os, io | No filesystem or OS access |
| dofile, loadfile, load | No loading arbitrary code |
| require | No module system (prevents file access) |
| collectgarbage | No GC manipulation |
| rawget, rawset, rawequal, rawlen | No metatable bypassing |
Available standard libraries: math, string, table, utf8, coroutine, and base functions (print, pairs, ipairs, tostring, tonumber, type, select, pcall, xpcall, error, assert, next, unpack).
Drawing API
All draw functions write to the overlay's render queue. Coordinates are in screen pixels (0,0 = top-left). Colors are packed 32-bit ABGR integers created with creed.Color().
DrawLine
Draws a line between two screen points.
- x1, y1
- Start point (screen pixels)
- x2, y2
- End point (screen pixels)
- color
- Packed color from
creed.Color() - thickness
- Line width in pixels (default:
1.0)
DrawBox / DrawFilledBox
Draws a rectangle outline or a filled rectangle.
- x, y
- Top-left corner (screen pixels)
- w, h
- Width and height
- color
- Packed color
- thickness
- Outline width (DrawBox only, default:
1.0)
DrawCircle / DrawFilledCircle
Draws a circle outline or filled circle.
- cx, cy
- Center point (screen pixels)
- radius
- Radius in pixels
- color
- Packed color
- thickness
- Outline width (DrawCircle only, default:
1.0) - segments
- Number of polygon segments (default:
32). Use lower values for performance or for polygon shapes.
DrawTriangle / DrawFilledTriangle
Draws a triangle outline or filled triangle from three screen points.
- x1, y1
- First vertex
- x2, y2
- Second vertex
- x3, y3
- Third vertex
- color
- Packed color
- thickness
- Outline width (DrawTriangle only, default:
1.0)
-- Draw a filled direction arrow
local cx, cy = 200, 200
creed.DrawFilledTriangle(cx, cy - 20, cx - 10, cy + 10, cx + 10, cy + 10,
creed.Color(255, 100, 100))
DrawText
Draws a string at the given screen position.
- text
- String to display (max 63 characters)
- x, y
- Top-left of the text (screen pixels)
- color
- Packed color
- fontSize
- Font size in pixels (default:
14.0)
Color
Creates a packed 32-bit color value. All draw functions expect this format.
- r, g, b
- Red, green, blue (0–255)
- a
- Alpha / opacity (0–255, default:
255= fully opaque)
local RED = creed.Color(255, 0, 0) -- solid red
local SEMI_BLACK = creed.Color( 0, 0, 0, 128) -- 50% transparent black
local GOLD = creed.Color(255, 200, 50) -- solid gold
ColorLerp NEW
Linearly interpolates between two colors. Useful for health bars, heat maps, and smooth transitions.
- color1
- Start color (packed)
- color2
- End color (packed)
- t
- Blend factor (0.0 = color1, 1.0 = color2)
local RED = creed.Color(255, 0, 0)
local GREEN = creed.Color(0, 255, 0)
-- Health bar that fades from red to green
local hpFrac = player.Health / player.MaxHealth
local barColor = creed.ColorLerp(RED, GREEN, hpFrac)
Game Data
GetEntities
Returns a list of all nearby game entities (players, vehicles, structures, mines, turrets).
- maxDistance
- Maximum distance in game units / cm (default:
10000= 100m)
local entities = creed.GetEntities(20000) -- 200m range
for _, ent in ipairs(entities) do
if ent.IsPlayer and not ent.IsLocalPlayer then
creed.Log(ent.ClassName .. " at " .. tostring(ent.Distance / 100) .. "m")
end
end
GetProjectiles
Returns all in-flight projectiles (grenades, mortars, artillery shells, rockets).
- maxDistance
- Maximum distance in game units (default:
50000)
GetLocalPlayer
Returns the local player's health, stamina, and position.
MaxHealth will be 0. Always check player.MaxHealth > 0 before using.
GetLocalTeam
Returns the local player's team ID.
0 (Colonial), 1 (Warden), or 255 (unknown).GetCamera
Returns the current camera state. Essential for radar rotation and WorldToScreen.
| Field | Type | Description |
|---|---|---|
| Position | Vector3 | Camera world position |
| Rotation | number | Camera yaw in degrees (0–360) |
| Pitch | number | Camera pitch angle in degrees |
| FOV | number | Field of view in degrees |
| OrthoWidth | number | Orthographic width (world units visible) |
| ProjectionMode | number | 0 = Perspective, 1 = Orthographic |
GetClosestEnemy
Finds the closest enemy to the crosshair within a maximum distance.
- maxDist
- Search range in game units (default:
50000) - playersOnly
- Only target player characters (default:
false) - targetVehicles
- Include vehicles as targets (default:
true) - fovRadius
- Crosshair FOV radius in pixels (default:
200)
.HasTarget before using.GetArtillery
Returns current artillery state if the player is manning an artillery piece.
.IsInArtillery first.GetWind
Returns current wind conditions from the game's weather system.
.Valid first.Utility Functions
WorldToScreen
Projects a 3D world position onto screen coordinates. Returns nil if the point is behind the camera or off-screen.
- worldX, worldY, worldZ
- World position (game units)
.X and .Y (screen pixels), or nil.local screen = creed.WorldToScreen(ent.Position.X, ent.Position.Y, ent.Position.Z)
if screen then
creed.DrawText(ent.ClassName, screen.X, screen.Y, WHITE)
end
WorldToRadar NEW
Converts a world position to radar screen coordinates with proper camera rotation. Handles clamping to the radar circle edge automatically.
- worldX, worldY
- Entity world position
- playerX, playerY
- Local player world position
- cameraYaw
- Camera rotation from
creed.GetCamera().Rotation - radarCX, radarCY
- Radar center on screen (pixels)
- radarRadius
- Radar size (pixels)
- radarRange
- Radar range (world units)
.X, .Y (screen pixels) and .InRange (bool).local cam = creed.GetCamera()
local player = creed.GetLocalPlayer()
local dot = creed.WorldToRadar(
ent.Position.X, ent.Position.Y,
player.Position.X, player.Position.Y,
cam.Rotation,
160, 160, -- radar center
140, -- radar pixel radius
15000) -- 150m range
creed.DrawFilledCircle(dot.X, dot.Y, 3, RED)
GetScreenSize
Returns the overlay's display dimensions.
.Width and .Height (pixels).GetDistance
Returns the 3D Euclidean distance between two Vector3 positions.
GetTime / GetDeltaTime
Returns the current time in milliseconds since system boot (monotonic). Useful for animations and timing.
Returns the time in seconds since the last call to GetDeltaTime(). Essential for frame-rate-independent animations.
local offset = 0
function OnTick()
local dt = creed.GetDeltaTime()
offset = offset + dt * 100 -- 100 pixels per second
creed.DrawFilledCircle(100 + offset, 100, 10, creed.Color(255, 255, 0))
end
GetFrameCount NEW
Returns a monotonically increasing frame counter. Useful for pulsing effects, alternating visuals, and periodic updates.
-- Blink every 30 frames
if creed.GetFrameCount() % 60 < 30 then
creed.DrawText("WARNING", 100, 100, RED, 24)
end
Lerp / Clamp NEW
Linear interpolation: returns a + (b - a) * t.
Clamps value between min and max.
IsGameStable
Returns true if the game is fully loaded and not in a loading screen or hex transition. Check this before reading entity data to avoid stale pointers.
Log
Appends a message to the script log visible in the overlay's Scripts tab. Useful for debugging.
Config System
The config system lets scripts declare user-configurable settings that appear in the overlay UI. Users can adjust them without editing your script.
RegisterConfig
Declares a user-configurable setting for this script. Call this at the
top level of your script (outside OnTick).
The setting appears in the overlay's script settings panel.
| Parameter | Type | Description |
|---|---|---|
key | string | Unique identifier (max 31 chars) |
type | string | "toggle" or "slider" |
options | table | Configuration options (see below) |
Toggle options:
| Field | Type | Default | Description |
|---|---|---|---|
label | string | key | Label shown in UI |
default | bool | false | Initial value |
Slider options:
| Field | Type | Default | Description |
|---|---|---|---|
label | string | key | Label shown in UI |
default | number | 0 | Initial value |
min | number | 0 | Minimum value |
max | number | 100 | Maximum value |
-- Declare configs at the top of your script
creed.RegisterConfig("radar_range", "slider", {
label = "Radar Range (m)",
default = 150,
min = 50,
max = 500
})
creed.RegisterConfig("show_friendlies", "toggle", {
label = "Show Friendlies",
default = true
})
GetConfig
Reads the current value of a config entry. For toggles, returns
1.0 (on) or 0.0 (off). For sliders,
returns the current slider value. The value is set by the user through the
overlay UI.
| Parameter | Type | Description |
|---|---|---|
key | string | The key passed to RegisterConfig |
function OnTick()
local range = creed.GetConfig("radar_range") -- slider value
local showFriends = creed.GetConfig("show_friendlies") > 0 -- toggle as bool
-- use values...
end
Per-Script Overlay Settings
Each loaded script has overlay-controlled rendering settings accessible from the Scripts tab (or the Lua Configuration section in the main menu). These are managed entirely by the overlay — scripts do not need to implement anything for these to work.
| Setting | Type | Default | Description |
|---|---|---|---|
| Visible | toggle | on | Hide/show all drawing output from this script |
| Draggable | toggle | on | Show a drag handle to reposition the script's output |
| Opacity | slider | 1.0 | Multiply the alpha of every draw call (0 = invisible, 1 = fully opaque) |
| Scale | slider | 1.0 | Scale all coordinates and sizes (0.25× – 4×) |
| Reset Position | button | — | Reset the drag offset back to (0, 0) |
These settings are automatically saved per-script and restored when the overlay restarts.
Types
Vector3
A 3D vector with arithmetic operators. Can be constructed or received from API calls.
local v = Vector3(100, 200, 300)
print(v.X, v.Y, v.Z)
-- Arithmetic
local sum = v + Vector3(10, 0, 0)
local diff = v - Vector3(0, 10, 0)
local scaled = v * 2.0
-- Methods
local len = v:Length()
local lenSq = v:LengthSquared()
local norm = v:Normalize()
local d = v:Dot(sum)
local dist = v:Distance(sum)
| Field / Method | Type | Description |
|---|---|---|
| X, Y, Z | number | Components (read/write) |
| Length() | number | Magnitude |
| LengthSquared() | number | Squared magnitude (faster, skip sqrt) |
| Normalize() | Vector3 | Unit vector (returns zero vector if length < 0.0001) |
| Dot(other) | number | Dot product |
| Distance(other) | number | Distance to another Vector3 |
| +, -, * | Vector3 | Add, subtract vectors; multiply by scalar |
| tostring() | string | "Vector3(x, y, z)" |
EntityInfo
Returned by creed.GetEntities(). Read-only. Represents any scanned game entity.
| Field | Type | Description |
|---|---|---|
| Address | number | Memory address (for advanced tracking) |
| Name | string | Internal UE4 actor name |
| ClassName | string | Class name (e.g. "SimCharacter", "WatchTower") |
| Position | Vector3 | World position (game units / cm) |
| Rotation | number | Yaw in degrees (0–360) |
| Distance | number | Distance from local player (cm) |
| TeamId | number | Team: 0 (Colonial), 1 (Warden) |
| Health | number | Current health |
| MaxHealth | number | Maximum health |
| Armor | number | Vehicle armor (0 if not a vehicle) |
| MaxArmor | number | Max armor |
| IsPlayer | boolean | True if this is a player character |
| IsVehicle | boolean | True if this is a vehicle |
| IsStructure | boolean | True if this is a building/structure |
| IsMine | boolean | True if this is a landmine or tripwire |
| IsListeningKit | boolean | True if this is a deployed listening kit |
| IsLocalPlayer | boolean | True if this is YOUR character |
| IsAITurret | boolean | True if AI-controlled turret (pillbox, garrison) |
| AITurretRange | number | AI turret max attack range (cm) |
| HasItemHolder | boolean | Has an inventory component |
| BoxOrigin | Vector3 | Bounding box center (world space) |
| BoxExtent | Vector3 | Bounding box half-extents |
| BoundRadius | number | Bounding sphere radius |
| HasValidBounds | boolean | True if bounding box data is valid |
| CapsuleHalfHeight | number | Player capsule half-height |
| CapsuleRadius | number | Player capsule radius |
| HasBoneData | boolean | True if skeleton bone data is available |
| ValidBoneCount | number | Number of readable bone positions |
GetBonePosition(index)
Returns the world position of a specific bone. Index is 0–16 (17 tracked bones). Returns nil if that bone wasn't successfully read.
ProjectileInfo
Returned by creed.GetProjectiles(). Read-only.
| Field | Type | Description |
|---|---|---|
| Address | number | Memory address |
| Name | string | Projectile actor name |
| Position | Vector3 | Current position |
| Velocity | Vector3 | Current velocity vector |
| PredictedImpact | Vector3 | Predicted landing position |
| Distance | number | Distance from local player |
| TimeToImpact | number | Estimated seconds until impact |
| Type | number | ProjectileType enum value |
| IsIncoming | boolean | Heading towards the player |
| IsDangerous | boolean | Will impact near the player |
PlayerStats
Returned by creed.GetLocalPlayer(). Read-only.
| Field | Type | Description |
|---|---|---|
| Health | number | Current health |
| MaxHealth | number | Maximum health (0 if not spawned) |
| Stamina | number | Current stamina |
| MaxStamina | number | Maximum stamina |
| Position | Vector3 | World position |
ArtilleryData
Returned by creed.GetArtillery(). Read-only.
| Field | Type | Description |
|---|---|---|
| IsInArtillery | boolean | Is the player manning artillery? |
| ArtilleryType | string | Type name (e.g. "LRArtillery", "Mortar") |
| GunnerYaw | number | Current gun yaw (degrees) |
| GunnerPitch | number | Current gun pitch (degrees) |
| ArtilleryPosition | Vector3 | Artillery piece world position |
WindData
Returned by creed.GetWind(). Read-only.
| Field | Type | Description |
|---|---|---|
| WindAzimuth | number | Wind direction (0–360 degrees) |
| WindSpeed | number | Wind speed (m/s) |
| Valid | boolean | Is wind data available? |
AimbotTarget
Returned by creed.GetClosestEnemy(). Read-only.
| Field | Type | Description |
|---|---|---|
| HasTarget | boolean | Is there a valid target? |
| Position | Vector3 | Target world position |
| Velocity | Vector3 | Target velocity (cm/s) |
| Distance | number | Distance to target |
| TeamId | number | Target team ID |
| IsVisible | boolean | Is target visible? |
| Name | string | Target actor name |
ProjectileType Enum
Available as a global table for comparing against ProjectileInfo.Type.
| Constant | Value | Description |
|---|---|---|
| ProjectileType.Unknown | 0 | Unknown projectile |
| ProjectileType.Grenade | 1 | Frag grenade |
| ProjectileType.Smoke | 2 | Smoke grenade |
| ProjectileType.Mortar | 3 | Mortar shell |
| ProjectileType.Artillery | 4 | Artillery shell |
| ProjectileType.Rocket | 5 | RPG / AT rocket |
| ProjectileType.Gas | 6 | Gas grenade |
Example Scripts
Radar
A classic top-down radar that rotates with the camera. Entities appear as colored dots clamped to the radar circle.
-- radar_example.lua
local RADAR_X, RADAR_Y = 160, 160
local RADAR_RADIUS = 140
local RADAR_RANGE = 15000 -- 150m
local BG = creed.Color(10, 10, 20, 180)
local BORDER = creed.Color(60, 65, 90, 200)
local ENEMY = creed.Color(255, 60, 60, 220)
local FRIEND = creed.Color(60, 200, 60, 150)
local WHITE = creed.Color(255, 255, 255)
function OnTick()
creed.DrawFilledCircle(RADAR_X, RADAR_Y, RADAR_RADIUS, BG)
creed.DrawCircle(RADAR_X, RADAR_Y, RADAR_RADIUS, BORDER, 2.0)
local player = creed.GetLocalPlayer()
if not player or player.MaxHealth <= 0 then return end
local cam = creed.GetCamera()
local myTeam = creed.GetLocalTeam()
for _, ent in ipairs(creed.GetEntities(RADAR_RANGE)) do
if not ent.IsLocalPlayer then
local dot = creed.WorldToRadar(
ent.Position.X, ent.Position.Y,
player.Position.X, player.Position.Y,
cam.Rotation,
RADAR_X, RADAR_Y, RADAR_RADIUS, RADAR_RANGE)
local color = (ent.TeamId == myTeam) and FRIEND or ENEMY
creed.DrawFilledCircle(dot.X, dot.Y, 3, color)
end
end
creed.DrawFilledCircle(RADAR_X, RADAR_Y, 4, WHITE)
end
ESP (Extra Sensory Perception)
Draws bounding boxes, labels, and health bars over enemy entities using WorldToScreen.
-- esp_example.lua
local RED = creed.Color(255, 50, 50, 220)
local GREEN = creed.Color(50, 255, 50)
local YELLOW = creed.Color(255, 255, 50)
function OnTick()
if not creed.IsGameStable() then return end
local myTeam = creed.GetLocalTeam()
for _, ent in ipairs(creed.GetEntities(30000)) do
if ent.TeamId ~= myTeam and not ent.IsLocalPlayer then
local screen = creed.WorldToScreen(
ent.Position.X, ent.Position.Y, ent.Position.Z + 90)
if screen then
local dist = ent.Distance / 100
local color = ent.IsVehicle and YELLOW or RED
local boxH = math.max(8, 60 - dist * 0.12)
local boxW = boxH * 0.5
creed.DrawBox(screen.X - boxW/2, screen.Y - boxH/2, boxW, boxH, color, 1.5)
creed.DrawText(string.format("%s %.0fm", ent.ClassName, dist),
screen.X - boxW/2, screen.Y + boxH/2 + 2, color, 12)
-- Health bar
if ent.MaxHealth > 0 then
local frac = creed.Clamp(ent.Health / ent.MaxHealth, 0, 1)
local hpColor = creed.ColorLerp(RED, GREEN, frac)
creed.DrawFilledBox(screen.X - boxW/2, screen.Y - boxH/2 - 4,
boxW * frac, 3, hpColor)
end
end
end
end
end
Artillery Helper
Displays wind info and incoming projectile warnings when operating artillery.
-- artillery_helper.lua
local INFO = creed.Color(100, 200, 255)
local WARN = creed.Color(255, 80, 80)
function OnTick()
local arty = creed.GetArtillery()
if not arty.IsInArtillery then return end
local screen = creed.GetScreenSize()
local x = screen.Width / 2 - 100
creed.DrawText(string.format("Yaw: %.1f Pitch: %.1f",
arty.GunnerYaw, arty.GunnerPitch), x, 10, INFO, 16)
local wind = creed.GetWind()
if wind.Valid then
creed.DrawText(string.format("Wind: %.1f m/s @ %.0f°",
wind.WindSpeed, wind.WindAzimuth), x, 30, INFO, 14)
end
-- Incoming shell warning
for _, proj in ipairs(creed.GetProjectiles(30000)) do
if proj.IsDangerous and proj.IsIncoming then
creed.DrawText(string.format("INCOMING %.1fs", proj.TimeToImpact),
screen.Width / 2 - 80, screen.Height / 2 - 50, WARN, 24)
break
end
end
end
Animated HUD
Shows smooth animations using GetDeltaTime, GetFrameCount, ColorLerp, and Lerp.
-- animated_hud.lua
local RED = creed.Color(255, 60, 60)
local GREEN = creed.Color(60, 255, 60)
local WHITE = creed.Color(255, 255, 255)
local smoothHP = 1.0
function OnTick()
local dt = creed.GetDeltaTime()
local player = creed.GetLocalPlayer()
if not player or player.MaxHealth <= 0 then return end
-- Smoothly animate health bar towards actual value
local targetHP = creed.Clamp(player.Health / player.MaxHealth, 0, 1)
smoothHP = creed.Lerp(smoothHP, targetHP, dt * 5.0)
-- Color fades from red to green based on health
local barColor = creed.ColorLerp(RED, GREEN, smoothHP)
-- Pulsing border when low HP
local frame = creed.GetFrameCount()
local pulse = (math.sin(frame * 0.1) + 1) * 0.5
local borderAlpha = smoothHP < 0.3 and (100 + pulse * 155) or 150
local x, y, w = 20, 20, 200
creed.DrawFilledBox(x, y, w, 16, creed.Color(0, 0, 0, 160))
creed.DrawFilledBox(x, y, w * smoothHP, 16, barColor)
creed.DrawBox(x, y, w, 16, creed.Color(200, 200, 200, borderAlpha), 1.0)
creed.DrawText(string.format("HP %.0f%%", smoothHP * 100), x + 4, y + 1, WHITE, 12)
end
Quick Reference
| Function | Description |
|---|---|
| creed.Color(r, g, b [, a]) | Create packed color |
| creed.ColorLerp(c1, c2, t) | Blend two colors |
| creed.DrawLine(x1, y1, x2, y2, c [, t]) | Line |
| creed.DrawBox(x, y, w, h, c [, t]) | Rectangle outline |
| creed.DrawFilledBox(x, y, w, h, c) | Filled rectangle |
| creed.DrawCircle(cx, cy, r, c [, t] [, seg]) | Circle outline |
| creed.DrawFilledCircle(cx, cy, r, c [, seg]) | Filled circle |
| creed.DrawTriangle(x1..y3, c [, t]) | Triangle outline |
| creed.DrawFilledTriangle(x1..y3, c) | Filled triangle |
| creed.DrawText(text, x, y, c [, size]) | Text string |
| creed.GetEntities([dist]) | Nearby entities |
| creed.GetProjectiles([dist]) | In-flight projectiles |
| creed.GetLocalPlayer() | Player HP, stamina, pos |
| creed.GetLocalTeam() | 0=Colonial, 1=Warden |
| creed.GetCamera() | Camera position, yaw, FOV |
| creed.GetClosestEnemy([...]) | Nearest enemy to crosshair |
| creed.GetArtillery() | Artillery state |
| creed.GetWind() | Wind direction/speed |
| creed.WorldToScreen(x, y, z) | 3D → screen coords |
| creed.WorldToRadar(wx, wy, px, py, yaw, ...) | 3D → radar coords |
| creed.GetScreenSize() | Overlay dimensions |
| creed.GetDistance(v1, v2) | 3D distance |
| creed.GetTime() | Time in ms (monotonic) |
| creed.GetDeltaTime() | Seconds since last call |
| creed.GetFrameCount() | Frame counter |
| creed.Lerp(a, b, t) | Linear interpolation |
| creed.Clamp(v, lo, hi) | Clamp value |
| creed.IsGameStable() | Game ready check |
| creed.Log(msg) | Debug log to overlay |