Evolve Lua Environment - Full Documentation
Overview
This guide explains every function, property, and module in the Evolve Lua environment. It is easy to read, with arguments explained and examples included so developers can immediately understand and use it.Printing & Logging
print(...values: any) -> nilArguments: | ...values |
Description: | Print values to console and log. |
Example: | print("Hello World", 123, true) -- Output: Hello World 123 true |
log(str: string) -> nilArguments: | str |
Description: | Writes a single string to logs/console. |
Example: | log("Loaded script") |
RBX (rbx.*)
rbx.viewport() -> (width: number, height: number)Example: | local w, h = rbx.viewport() print("Viewport:", w, h) |
rbx.world_to_screen(vector: Vector3) -> {visible: boolean, x: number, y: number}Arguments: | vector |
Example: | local pt = rbx.world_to_screen(Vec3(0, 10, 0)) if pt.visible then print("On screen at:", pt.x, pt.y) end |
rbx.entities() -> {Entity[]}Example: | for _, e in pairs(rbx.entities()) do print(e.Name, e.Health) end |
Entity
Represents a player/entity in Roblox.
Entity.name -> stringDescription: | Alias to Entity.Name |
Entity.health -> numberDescription: | Alias to Entity.Health |
Entity:distance_to(vector: Vector3) -> number Entity:bone(name: string) -> Vector3 Entity:has_bone(name: string) -> boolean Entity:bones() -> {Vector3, ...} Entity.Instance -> Instance Entity.upper_torso -> unknown Entity.lower_torso -> unknown Entity.root_part -> unknown Drawing (draw.*)
draw.rgba(r, g, b, [a]) -> ImU32Arguments: | r, g, b, a |
Description: | Construct a color. |
Example: | local col = draw.rgba(255, 0, 0, 255) |
draw.line(x1, y1, x2, y2, color, [thickness]) -> nilArguments: | x1, y1, x2, y2, color, thickness |
draw.rect(x: number, y: number, w: number, h: number, color: ImU32, thickness?: number, rounding?: number) -> nilArguments: | x, y, w, h, color, thickness, rounding |
draw.rect_filled(x, y, w, h, color, [rounding]) -> nilArguments: | x, y, w, h, color, rounding |
draw.circle(x, y, r, color, [thickness]) -> nilArguments: | x, y, r, color, thickness |
draw.circle_filled(x, y, r, color) -> nilArguments: | x, y, r, color |
draw.text(x, y, color, text, [size]) -> nilArguments: | x, y, color, text, size |
draw.triangle(x1, y1, x2, y2, x3, y3, color, [thickness]) -> nilArguments: | x1, y1, x2, y2, x3, y3, color, thickness |
draw.quad(x1, y1, x2, y2, x3, y3, x4, y4, color, [thickness]) -> nilArguments: | x1, y1, x2, y2, x3, y3, x4, y4, color, thickness |
draw.polyline(vectors: {Vector2, ...}, color, closed, [thickness]) -> nilArguments: | vectors, color, closed, thickness |
draw.GetTextSize(str: string) -> (w: number, h: number) draw.GetPartCorners(inst: Instance) -> {Vector3, ...} Instance API (Instance)
Instance:valid() -> boolean Instance:Name() -> string Instance:ClassName() -> string Instance:Parent() -> Instance Instance:Children() -> {Instance, ...} Instance:FindFirstChild(name: string) -> Instance Instance:IsA(class) -> boolean Instance:Position() -> Vector3 Instance:Size() -> Vector3 Instance:CFrame() -> CFrame Instance:Velocity() -> Vector3 Instance:Descendants() -> {Instance, ...} Instance:FindFirstAncestor() -> Instance Instance:FindFirstAncestorOfClass() -> Instance Instance:FindFirstDescendant() -> Instance Instance:FindFirstDescendantOfClass() -> Instance Camera API (Camera)
Camera:Position() -> Vector3 Camera:LookVector() -> Vector3 Camera:GetCFrame() -> CFrame Camera:FocusCFrame() -> CFrame Camera:RightVector() -> Vector3 Camera:UpVector() -> Vector3
input.is_down(key: number) -> boolean input.was_pressed(key: number) -> boolean input.was_released(key: number) -> boolean input.toggled(key: number) -> boolean input.mouse_pos() -> Vector2 input.mouse_delta() -> Vector2 input.mouse.Click(btn: string) -> nilArguments: | btn |
Example: | input.mouse.Click("leftmouse") -- can either be "leftmouse" or "rightmouse" |
input.mouse.IsClicked(btn: string) -> booleanArguments: | btn |
Example: | local clicked = input.mouse.IsClicked("rightmouse") if (clicked == true) then print(clicked) end |
input.mouse.Scroll(delta: number) -> nil input.keyboard.Press(key: string) -> nilArguments: | key |
Example: | input.keyboard.Press("e") -- Press "e" key |
input.keyboard.Release(key: string) -> nilArguments: | key |
Example: | input.keyboard.Release("e") -- Release "e" key |
input.keyboard.Click(key: string, release: number) -> nilArguments: | key, release |
Description: | Press the key for release milliseconds then release. |
Example: | input.keyboard.Click("f5", 50) -- Press "f5" key for 50 ms then release |
input.keyboard.IsPressed(key: string) -> nilArguments: | key |
Example: | local pressed = input.keyboard.IsPressed("space") if (pressed == true) then print(pressed) end |
Utility API (utility.*)
utility.RandomInt(min: number, max: number) -> numberArguments: | min, max |
Description: | Returns an integer between min and max. |
utility.RandomFloat(min: number, max: number) -> numberArguments: | min, max |
Description: | Returns a float between min and max. |
utility.GetTickCount() -> number utility.GetDeltaTime() -> number utility.GetMousePos() -> {X: number, Y: number} utility.WorldToScreen(vector: Vector3) -> (x: number, y: number, visible: boolean) utility.SetClipboard(str: string) -> nil utility.GetClipboard() -> string utility.MoveMouse(dx: number, dy: number) -> nil File API (file.*)
file.read(file: string) -> string | nil file.write(file: string, data: string) -> boolean HTTP API (http.*)
http.Get(url: string, headers?: any, callback: function) -> nilArguments: | url, headers, callback |
http.Post(url: string, headers?: any, body: any, callback: function) -> nilArguments: | url, headers, body, callback |
Evolve API (evolve.*)
evolve.register(event: string, function: function) -> nilEvents: | "onUpdate", "onPaint", "onSlowUpdate", "shutdown", "newPlace" |
Notes: | The argument dt is provided when the event "onUpdate" is fired. |
Arguments: | event, function |
Description: | event can be one of the events above. |
evolve.getWindowSize() -> (w: number, h: number)