Reference

API docs

Everything Solara adds on top of Luau, and what each one does. 119 functions.

compatibility marks a function kept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

Environment

getgenv

function getgenv(): { any }

Returns the executor global environment, shared by every script the executor runs.

Example
getgenv().dummy_val = "value"
getfenv().dummy_val_2 = 1

print(dummy_val, getgenv().dummy_val_2) -- Output: value, nil

getgenv().dummy_val = "value2"
dummy_val = nil
print(dummy_val) -- Output: value2

getreg

function getreg(): { [any]: any }

Returns the Luau registry table.

Example
local loop_thread = task.spawn(function()
    while task.wait(1) do
        print("I am still running...")
    end
end)

task.wait(0.2) -- Let the loop run for a bit

for _, value in getreg() do
    if value ~= loop_thread then continue end

    print(`Found loop thread: {loop_thread}`) -- Should print
    coroutine.close(loop_thread) -- Should close the thread

    break
end

getrenv compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function getrenv(): { any }

Returns the global environment table.

checkcaller

function checkcaller(): boolean

Returns whether the current function was called by the executor.

Example
print(checkcaller()) -- Output: true (running from the executor)

local connection = workspace.ChildAdded:Connect(function()
    print(checkcaller()) -- Output: false (called by the engine)
end)

Instance.new("Part", workspace)
task.wait()
connection:Disconnect()

require

function require(module: ModuleScript | number): any

Loads a ModuleScript, or a module by asset ID, and returns what it returns.

Example
local module = require(game:GetService("ReplicatedStorage").MyModule)

-- or by asset ID
local remote = require(1234567890)

Closures

newcclosure compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function newcclosure<A..., R...>(functionToWrap: (A...) -> R...): (A...) -> R...

Returns a C closure that calls the supplied function, passing through all arguments and returns.

clonefunction compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function clonefunction<A..., R...>(functionToClone: (A...) -> R...): (A...) -> R...

Returns a function that behaves the same as the one supplied.

newlclosure

function newlclosure<A..., R...>(functionToWrap: (A...) -> R...): (A...) -> R...

Returns a Luau closure that calls the supplied function, passing through all arguments and returns.

Example
local wrapped = newlclosure(function(value)
    return value * 2
end)

print(wrapped(21))         --> 42
print(islclosure(wrapped)) --> true

iscclosure

function iscclosure(func: (...any) -> (...any)): boolean

Returns whether a function is a C closure.

Example
local function dummy_lua_function()
    print("This is an executor Luau closure")
end

local dummy_cfunction = newcclosure(function()
    print("This is an Executor C Closure")
end)

local dummy_standard_function = print
local dummy_global_cfunction = getgenv

print(iscclosure(dummy_cfunction)) -- Output: true
print(iscclosure(dummy_global_cfunction)) -- Output: true
print(iscclosure(dummy_standard_function)) -- Output: true
print(iscclosure(dummy_lua_function)) -- Output: false

islclosure

function islclosure(func: (...any) -> (...any)): boolean

Returns whether a function is a Luau closure.

Example
local function dummy_lua_function()
    print("This is an executor Luau closure")
end

local dummy_cfunction = newcclosure(function()
    print("This is an executor C closure")
end)

local dummy_standard_cfunction = print

print(islclosure(dummy_lua_function)) -- Output: true
print(islclosure(dummy_standard_cfunction)) -- Output: false
print(islclosure(dummy_cfunction)) -- Output: false

loadstring

function loadstring<A...>(source: string, chunkname: string?): (((A...) -> any) | nil, string?)

Compiles Luau source and returns it as a function. On failure, returns nil and an error message.

Example
loadstring([[
    placeholder = {"Example"}
]])()

print(placeholder[1]) -- Output: Example

Metatable

getrawmetatable

function getrawmetatable(object: { any } | userdata): { [any]: any } | nil

Returns an object's metatable, ignoring __metatable protection.

Example
local mt = getrawmetatable(game)
print(type(mt)) -- Output: table
print(mt.__index(game, "Workspace")) -- Output: Workspace

getnamecallmethod

function getnamecallmethod(): string?

Returns the method name of the __namecall currently being handled.

Example
local mt = getrawmetatable(game)
local original = rawget(mt, "__namecall")

setreadonly(mt, false)
rawset(mt, "__namecall", function(self, ...)
    local method = getnamecallmethod()
    print("called:", method) -- Output: called: GetService

    return original(self, ...)
end)

game:GetService("Players")

rawset(mt, "__namecall", original)
setreadonly(mt, true)

setreadonly

function setreadonly(table: { any }, state: boolean): ()

Sets whether a table is read-only.

Example
local mt = getrawmetatable(game)
mt.Example = "Hello" -- Throws an error

setreadonly(mt, false)
mt.Example = "Hello"
print(mt.Example) -- Output: Hello

setreadonly(mt, true) -- Lock back

isreadonly

function isreadonly(table: { any }): boolean

Returns whether a table is read-only.

Example
print(isreadonly({})) -- Output: false
print(isreadonly(getrawmetatable(game))) -- Output: true

Reflection & identity

getthreadidentity

function getthreadidentity(): number

Returns the identity of the current thread.

Aliasesgetidentitygetthreadcontext

Example
task.defer(function()
    setthreadidentity(2)
    print(getthreadidentity()) -- Output: 2
end)

setthreadidentity(3)
print(getthreadidentity())     -- Output: 3

setthreadidentity

function setthreadidentity(id: number): ()

Sets the identity of the current thread.

Aliasessetidentitysetthreadcontext

Example
setthreadidentity(2)
print(game:GetService("CoreGui")) -- nil

setthreadidentity(8)
print(game:GetService("CoreGui")) -- CoreGui

isscriptable

function isscriptable(instance: Instance, property: string): boolean

Returns whether a property can be read and written by normal indexing.

Example
local part = Instance.new("Part")

setscriptable(part, "Name", false)

print(isscriptable(part, "Name")) -- false

setscriptable

function setscriptable(instance: Instance, property: string, state: boolean): boolean | nil

Sets whether a property can be read and written by normal indexing, and returns its previous state.

Example
setscriptable(workspace, "SignalBehavior", true)
print(workspace.SignalBehavior) -- Output:  Enum.SignalBehavior...

setscriptable(workspace, "SignalBehavior", false)
print(workspace.SignalBehavior) -- Throws an error

gethiddenproperty

function gethiddenproperty(instance: Instance, property: string): (any, boolean)

Returns the value of a property that normal indexing cannot reach, plus whether it was hidden.

Example
local part = Instance.new("Part")

print(gethiddenproperty(part, "Name"))       -- Output: Part, false
print(gethiddenproperty(part, "DataCost"))   -- Output: 20, false
print(gethiddenproperty(part, "NetworkOwnerV3"))   -- Output: -1, true

sethiddenproperty

function sethiddenproperty(instance: Instance, property: string, value: any): boolean

Sets the value of a property that normal indexing cannot reach.

Example
local part = Instance.new("Part")

print(gethiddenproperty(part, "IsInSandbox")) -- Output: false, true

sethiddenproperty(part, "IsInSandbox", true)

print(gethiddenproperty(part, "IsInSandbox")) -- Output: true, true

isnetworkowner

function isnetworkowner(part: BasePart): boolean

Returns whether the local player currently has network ownership of a part.

Example
local root = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart
print(isnetworkowner(root)) --> true

Instances

cloneref compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function cloneref<T>(object: T & Instance): T

Returns a reference to the supplied Instance.

compareinstances compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function compareinstances(object1: Instance, object2: Instance): boolean

Returns whether two references point to the same Instance.

gethui compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function gethui(): Instance

Returns the container to parent executor UI into.

Aliasesget_hidden_gui

getinstances

function getinstances(): { Instance }

Returns the Instances known to the client.

Example
local dummy_part = Instance.new("Part")
dummy_part.Parent = nil

for _, instance in getinstances() do
    if instance == dummy_part then
        print("Found the dummy part!")
    end
end

getnilinstances

function getnilinstances(): { Instance }

Returns the Instances whose Parent is nil.

Example
local part = Instance.new("Part")
for _, instance in getnilinstances() do
    if instance == part then
        print("Found our unattached part!")
    end
end

Scripts

getscripts

function getscripts(): { BaseScript | ModuleScript }

Returns the game's ModuleScript, LocalScript, and Script instances. Core scripts are excluded.

Example
local dummy_script = Instance.new("LocalScript")
dummy_script.Name = "TestScript"

for _, script in getscripts() do
    if script == dummy_script then
        print("Found the dummy script!")
    end
end

getrunningscripts compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function getrunningscripts(): { BaseScript | ModuleScript }

Returns the scripts that are currently running.

getloadedmodules compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function getloadedmodules(): { ModuleScript }

Returns the ModuleScripts that have been loaded.

getscriptclosure compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function getscriptclosure(script: LuaSourceContainer): (...any) -> (...any) | nil

Returns a callable function built from a script.

Aliasesgetscriptfunction

getscriptbytecode

function getscriptbytecode(script: BaseScript | ModuleScript): string | nil

Returns a script's bytecode, or nil when it is unavailable.

Aliasesdumpstring

Example
local animate = game.Players.LocalPlayer.Character:FindFirstChild("Animate")

print(getscriptbytecode(animate)) -- Returns bytecode as a string

print(getscriptbytecode(Instance.new("LocalScript"))) -- Output: nil

getscripthash

function getscripthash(script: BaseScript | ModuleScript): string | nil

Returns an uppercase hexadecimal BLAKE3-256 hash of a script's bytecode, 64 characters long, or nil when unavailable.

Example
local Animate = game.Players.LocalPlayer.Character:FindFirstChild("Animate")

print(getscripthash(Animate)) -- Output: 64 uppercase hex characters

print(getscripthash(Instance.new("LocalScript"))) -- Output: nil

decompile

function decompile(script: LuaSourceContainer): string | nil

Returns decompiled source for a script. On failure, returns the error as a comment.

Aliasesdisassemble

Example
local source = decompile(someLocalScript)
print(source)

saveinstance

function saveinstance(target: { Instance } | { [string]: any }, options: { [string]: any }?): ()

Saves an Instance and its descendants to a file, and yields until it finishes. Pass instances, an options table, or both. This follows UniversalSynSaveInstance, so the full option list lives in its documentation. The ones you will reach for most are SafeMode (defaults to true), Decompile (defaults to true), and FilePath.

Example
-- save the whole place with defaults
saveinstance()

-- save specific instances
saveinstance({ workspace.Model, workspace.Part })

-- with options
saveinstance({
    FilePath = "my-place",
    SafeMode = false,
    Decompile = true,
})

lrm_load_script

function lrm_load_script(script_id: string): any

Loads and runs a Luarmor script by ID.

Example
lrm_load_script("your-script-id")

HTTP & miscellaneous

request

type RequestOptions = {
    Url: string,
    Method: "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "OPTIONS" | "PATCH",
    Body: string?,
    Headers: { [string]: string }?,
    Cookies: { [string]: string }?
}

type Response = {
    Success: boolean,
    Body: string,
    StatusCode: number,
    StatusMessage: string,
    Headers: { [string]: string }
}

function request(options: RequestOptions): Response

Sends an HTTP request and yields until the response arrives.

Aliaseshttp_requesthttpRequesthttprequesthttp.request

Example
local response = request({
    Url = "http://httpbin.org/get",
    Method = "GET",
})

local decoded = game:GetService("HttpService"):JSONDecode(response.Body)
local retrieved_fingerprint

for key in pairs(decoded.headers) do
    if key:match("Fingerprint") then
        retrieved_fingerprint = key
        break
    end
end

print(response.StatusCode)         -- Output: 200
print(response.Success)            -- Output: true
print(retrieved_fingerprint)        -- Output: PREFIX-Fingerprint

gethwid

function gethwid(): string

Returns the device HWID.

Example
print(gethwid())

identifyexecutor

function identifyexecutor(): (string, string)

Returns the executor name and version: Solara, 3.0.

Aliasesgetexecutorname

Example
local exec_name, exec_version = identifyexecutor()
print(exec_name, exec_version) -- Output: "YourExploitName 0.0.1"

messagebox

function messagebox(text: string, caption: string?, style: number?): number

Creates a message box with the given text, caption, and style, and returns which button was pressed. Caption defaults to Message Box, style to 0.

Style
ValueButtons
0OK
1OK / Cancel
2Abort / Retry / Ignore
3Yes / No / Cancel
4Yes / No
5Retry / Cancel
6Cancel / Try Again / Continue
Returns
CodeButton pressed
1OK
2Cancel
3Abort
4Retry
5Ignore
6Yes
7No
10Try Again
11Continue
Example
-- style 4 is Yes / No
local result = messagebox("Continue?", "Solara", 4)

if result == 6 then
    print("yes")
elseif result == 7 then
    print("no")
end

Clipboard

setclipboard

function setclipboard(data: string): ()

Copies a string to the system clipboard.

Aliasestoclipboardsetrbxclipboard

Example
setclipboard("copied to the clipboard")

Settings

setfpscap

function setfpscap(cap: number | string): ()

Sets the client framerate cap.

Example
setfpscap(240)  -- cap at 240
setfpscap(0)    -- uncapped

getfpscap

function getfpscap(): number

Returns the current framerate cap.

Example
print(getfpscap()) --> 240

setsimulationradius

function setsimulationradius(radius: number, maxRadius: number?): ()

Sets the local player's simulation radius. maxRadius defaults to radius.

Example
setsimulationradius(1000)
setsimulationradius(1000, 1000)

setfflag compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function setfflag(name: string, value: boolean): any

Defines a fast flag.

getfflag compatibilityKept so older scripts keep running. What it does here may not match the same name in other executors, so prefer something else where you can.

function getfflag(name: string): any

Returns the value of a fast flag.

Interactions

fireclickdetector

function fireclickdetector(detector: ClickDetector, distance: number?, event: string?): ()

Fires a ClickDetector event. Accepted events are MouseClick, MouseHoverEnter, MouseHoverLeave, and RightMouseClick.

Example
local click_detector = Instance.new("ClickDetector")

click_detector.MouseClick:Connect(function(player)
    print(`{player.Name} Fired M1`)
end)

click_detector.RightMouseClick:Connect(function(player)
    print(`{player.Name} Fired M2`)
end)

click_detector.MouseHoverEnter:Connect(function(player)
    print(`{player.Name} Fired HoverEnter`)
end)

click_detector.MouseHoverLeave:Connect(function(player)
    print(`{player} Fired HoverLeave`)
end)

fireclickdetector(click_detector, 0, "MouseClick") -- Output: Player Fired M1
fireclickdetector(click_detector, 0, "RightMouseClick") -- Output: Player Fired M2
fireclickdetector(click_detector, 0, "MouseHoverEnter") -- Output: Player Fired HoverEnter
fireclickdetector(click_detector, 0, "MouseHoverLeave") -- Output: Player Fired HoverLeave

fireproximityprompt

function fireproximityprompt(prompt: ProximityPrompt): ()

Fires a ProximityPrompt.

Example
local part = Instance.new("Part", workspace)
local prompt = Instance.new("ProximityPrompt", part)
prompt.ActionText = "Click Me"

prompt.Triggered:Connect(function(player)
    print(player.Name .. " triggered the prompt")
end)

fireproximityprompt(prompt) -- Output: [YourName] triggered the prompt

firetouchinterest

function firetouchinterest(part1: BasePart, part2: BasePart, toggle: boolean | number): ()

Simulates a touch between two parts. Numeric toggle values must be 0 or 1.

Example
local dummy_part = Instance.new("Part")
dummy_part.CFrame = CFrame.new(0, -200, 0)
dummy_part.Anchored = true
dummy_part.Parent = workspace

dummy_part.Touched:Connect(function(part)
    print(part.Name .. " touched the dummy part!")
end)

local player_head = game.Players.LocalPlayer.Character.Head

firetouchinterest(player_head, dummy_part, true) -- Simulate touch
task.wait(0.5)
firetouchinterest(player_head, dummy_part, false) -- Simulate un-touch

Teleport

queue_on_teleport

function queue_on_teleport(code: string): ()

Queues code to run after the next teleport.

Aliasesqueueonteleport

Example
queue_on_teleport([[
    print("this runs in the next place")
]])

clearqueueonteleport

function clearqueueonteleport(): ()

Clears everything queued for the next teleport.

Aliasesclearteleportqueueclear_teleport_queue

Example
clearqueueonteleport()

Filesystem

isfile

function isfile(path: string): boolean

Returns whether a path exists and is a file.

Example
print(isfile("nonexistent.txt")) -- Output: false
writefile("file3.txt", "")
print(isfile("file3.txt")) -- Output: true

readfile

function readfile(path: string): string

Returns a file's contents. Errors if the file does not exist.

Example
writefile("file0.txt", "Hello")
print(readfile("file0.txt")) -- Output: Hello

isfolder

function isfolder(path: string): boolean

Returns whether a path exists and is a folder.

Example
writefile("file7.txt", "")
makefolder("folder2")
print(isfolder("file7.txt")) -- Output: false
print(isfolder("folder2"))   -- Output: true

writefile

function writefile(path: string, content: string): ()

Writes content to a file, replacing anything already there.

Example
writefile("file.txt", "Hello world")
print(readfile("file.txt")) -- Output: Hello world

appendfile

function appendfile(path: string, content: string): ()

Appends content to the end of a file.

Example
writefile("file4.txt", "print(")
appendfile("file4.txt", "'Hello')")
print(readfile("file4.txt")) -- Output: print('Hello')

delfolder

function delfolder(path: string): ()

Deletes a folder.

Example
makefolder("folder3")
print(isfolder("folder3")) -- Output: true
delfolder("folder3")
print(isfolder("folder3")) -- Output: false

delfile

function delfile(path: string): ()

Deletes a file.

Example
writefile("file5.txt", "Hello")
print(isfile("file5.txt")) -- Output: true
delfile("file5.txt")
print(isfile("file5.txt")) -- Output: false

makefolder

function makefolder(path: string): ()

Creates a folder.

Example
makefolder("test_folder")
print(isfolder("test_folder")) -- Output: true

listfiles

function listfiles(path: string?): { string }

Returns the files and folders inside a path. Omitting the path lists the workspace root.

Example
writefile("file1.txt", "")
writefile("file2.lua", "")
task.wait()

for _, file in listfiles("") do
    if file == "file1.txt" then
        print(`Found: {file}`) -- Output: Found: file1.txt
    end
    if file == "file2.lua" then
        print(`Found: {file}`) -- Output: Found: file2.lua
    end
end

getcustomasset

function getcustomasset(path: string): string

Returns an rbxasset:// content ID for a local file, usable anywhere Roblox accepts one.

Example
local encoded = game:HttpGet("https://gitlab.com/sens3/nebunu/-/raw/main/encodedBytecode.txt")
writefile("ExampleSound.mp3", base64decode(encoded))

local asset_id = getcustomasset("ExampleSound.mp3")

local sound = Instance.new("Sound")
sound.Parent = workspace
sound.SoundId = asset_id
sound.Volume = 0.35
sound:Play()

loadfile

function loadfile(path: string, chunkName: string?): (((...any) -> any) | nil, string?)

Compiles a file and returns it as a function. The chunk name defaults to the path.

Example
writefile("file6.lua", "return 10 + ...")
local chunk = loadfile("file6.lua")
print(chunk(1)) -- Output: 11

dofile

function dofile(path: string): any

Compiles a file and runs it immediately.

Example
dofile("scripts/main.lua")

Encoding & cryptography

base64encode

function base64encode(data: string | buffer): string | buffer

Base64-encodes a string or buffer. The return type matches the input.

Aliasesbase64_encodecrypt.base64encodecrypt.base64_encodecrypt.base64.encodebase64.encode

Example
print(base64encode("DummyString\0\2")) -- Output: RHVtbXlTdHJpbmcAAg==

base64decode

function base64decode(data: string | buffer): string | buffer

Base64-decodes a string or buffer. The return type matches the input.

Aliasesbase64_decodecrypt.base64decodecrypt.base64_decodecrypt.base64.decodebase64.decode

Example
local bytecode = game:HttpGet("https://api.rubis.app/v2/scrap/zuxQZuM9Tnl5MRbo/raw")
writefile("sound.mp3", base64decode(bytecode)) -- This file should be a valid and working MP3 file.

lz4compress

function lz4compress(data: string | buffer): string | buffer

Compresses data with LZ4. The return type matches the input.

Aliasescrypt.lz4compress

Example
local text = "Hello, world! Hello, world! Goodbye, world!"
print(#text) -- 43
print(#lz4compress(text)) -- 34

lz4decompress

function lz4decompress(data: string | buffer, size: number): string | buffer

Decompresses LZ4 data. size is the expected uncompressed length and is required. The return type matches the input.

Aliasescrypt.lz4decompress

Example
local text = "Hello, world! Hello, world!"
local compressed = lz4compress(text)

-- the original length is required
print(lz4decompress(compressed, #text)) -- Output: Hello, world! Hello, world!

zstdcompress

function zstdcompress(data: string | buffer, compressionLevel: number?): string | buffer

Compresses data with Zstandard. compressionLevel defaults to 1.

Aliasescrypt.zstd.compress

Example
local packed = zstdcompress(string.rep("solara", 100))
print(#packed)

zstddecompress

function zstddecompress(data: string | buffer): string | buffer

Decompresses Zstandard data. The return type matches the input.

Aliasescrypt.zstd.decompress

Example
local data = string.rep("solara", 100)
local packed = zstdcompress(data)

print(zstddecompress(packed) == data) --> true

crypt.encrypt

function crypt.encrypt(data: string, key: string, iv: string?, mode: string): (string, string)

Encrypts data and returns the result alongside the IV.

Example
local key = crypt.generatekey()
local encrypted, iv = crypt.encrypt("secret", key, nil, "CBC")

print(encrypted, iv)

crypt.decrypt

function crypt.decrypt(data: string, key: string, iv: string?, mode: string): string

Decrypts data.

Example
local key = crypt.generatekey()
local encrypted, iv = crypt.encrypt("secret", key, nil, "CBC")

print(crypt.decrypt(encrypted, key, iv, "CBC")) --> secret

crypt.generatekey

function crypt.generatekey(): string

Returns a randomly generated key.

Example
local key = crypt.generatekey()
print(key)

crypt.generatebytes

function crypt.generatebytes(size: number): string

Returns size random bytes. size must be greater than zero.

Example
print(crypt.generatebytes(16))

crypt.hash

function crypt.hash(data: string, algorithm: string): string

Returns a hash of the data using the named algorithm.

Example
print(crypt.hash("hello", "sha256"))

WebSocket

WebSocket.connect

function WebSocket.connect(url: string): WebSocketClient

Connects to a ws:// or wss:// endpoint and returns a socket.

Example
local socket = WebSocket.connect("wss://echo.websocket.org")

socket.OnMessage:Connect(function(message)
    print("received:", message)
end)

socket.OnClose:Connect(function()
    print("closed")
end)

socket:Send("hello")

WebSocketClient:Send

function WebSocketClient:Send(message: string): boolean

Sends a text message. Returns false if the socket is closed or the send fails.

Example
local ok = socket:Send("hello")

if not ok then
    warn("socket is closed")
end

WebSocketClient:Close

function WebSocketClient:Close(): ()

Closes the socket. Calling it more than once is safe.

Example
socket:Close()

WebSocketClient.OnMessage:Connect

function WebSocketClient.OnMessage:Connect(callback: (message: string) -> ()): Connection

Runs a callback for every incoming message. Lowercase .connect also works.

Example
local connection = socket.OnMessage:Connect(function(message)
    print(message)
end)

connection:Disconnect()

WebSocketClient.OnClose:Connect

function WebSocketClient.OnClose:Connect(callback: () -> ()): Connection

Runs a callback once the socket closes. Lowercase .connect also works.

Example
socket.OnClose:Connect(function()
    print("the socket closed")
end)

Connection:Disconnect

function Connection:Disconnect(): ()

Stops a listener from receiving further events. Lowercase .disconnect also works.

Example
local connection = socket.OnMessage:Connect(print)
connection:Disconnect()

Input

keypress

function keypress(key: number): ()

Holds down a virtual-key code.

Example
keypress(0x20) -- hold space
task.wait(0.5)
keyrelease(0x20)

keyrelease

function keyrelease(key: number): ()

Releases a virtual-key code.

Example
keypress(0x57) -- W
task.wait(1)
keyrelease(0x57)

keyclick

function keyclick(key: number): ()

Presses and releases a key.

Aliaseskeytap

Example
keyclick(0x45) -- tap E

mouse1click

function mouse1click(): ()

Clicks the left mouse button.

mouse1press

function mouse1press(): ()

Holds down the left mouse button.

mouse1release

function mouse1release(): ()

Releases the left mouse button.

mouse2click

function mouse2click(): ()

Clicks the right mouse button.

mouse2press

function mouse2press(): ()

Holds down the right mouse button.

mouse2release

function mouse2release(): ()

Releases the right mouse button.

mousescroll

function mousescroll(pixels: number): ()

Scrolls the mouse wheel.

Example
mousescroll(120)  -- up
mousescroll(-120) -- down

mousemoverel

function mousemoverel(x: number, y: number): ()

Moves the cursor relative to where it is now.

Example
mousemoverel(100, 0) -- 100 pixels right

mousemoveabs

function mousemoveabs(x: number, y: number): ()

Moves the cursor to an absolute position.

Example
mousemoveabs(960, 540)

isrbxactive

function isrbxactive(): boolean

Returns whether the Roblox window is focused.

Aliasesisgameactiveiswindowactive

Example
if isrbxactive() then
    mouse1click()
end

Input library

Input.LeftClick

function Input.LeftClick(action: string): ()

Presses or releases the left mouse button. Pass MOUSE_DOWN or MOUSE_UP.

Example
Input.LeftClick("MOUSE_DOWN")
task.wait(0.1)
Input.LeftClick("MOUSE_UP")

Input.MoveMouse

function Input.MoveMouse(x: number, y: number): ()

Moves the cursor relative to where it is now.

Input.ScrollMouse

function Input.ScrollMouse(amount: number): ()

Scrolls the mouse wheel.

Input.KeyPress

function Input.KeyPress(key: number): ()

Presses and releases a key.

Example
Input.KeyPress(0x45) -- tap E

Input.KeyDown

function Input.KeyDown(key: number): ()

Holds down a key.

Example
Input.KeyDown(0x57) -- hold W
task.wait(1)
Input.KeyUp(0x57)

Input.KeyUp

function Input.KeyUp(key: number): ()

Releases a key.

DataModel methods

game:HttpGet

function DataModel:HttpGet(url: string): string

Sends a GET request and returns the response body.

Aliasesgame:HttpGetAsync

Example
local body = game:HttpGet("https://api.github.com")
print(body)

game:HttpPost

function DataModel:HttpPost(url: string, data: string, synchronousOrContentType: boolean | string?, contentTypeOrSynchronous: string | boolean?): string

Sends a POST request and returns the response body. Content type defaults to text/plain, and the last two arguments may be given in either order.

Example
local body = game:HttpPost(
    "https://httpbin.org/post",
    '{"hello":"world"}',
    "application/json"
)
print(body)

game:GetObjects

function DataModel:GetObjects(asset: number | string): { Instance }

Loads an asset and returns it in an array.

Example
local objects = game:GetObjects("rbxassetid://1234567890")
objects[1].Parent = workspace

Drawing

Drawing.new

function Drawing.new(type: "Line" | "Text" | "Circle" | "Square" | "Image" | "Quad" | "Triangle"): Drawing

Creates a drawing object rendered above the game. Every type has Visible, ZIndex, Transparency, Color, Remove(), and Destroy().

Example
local text = Drawing.new("Text")
text.Text = "Solara"
text.Size = 20
text.Position = Vector2.new(100, 100)
text.Color = Color3.fromRGB(255, 255, 255)
text.Outline = true
text.Visible = true

task.wait(3)
text:Remove()

Drawing.Fonts

Drawing.Fonts = { UI = 0, System = 1, Plex = 2, Monospace = 3 }

The fonts a Text drawing can use.

Example
local text = Drawing.new("Text")
text.Font = Drawing.Fonts.Monospace

setrenderproperty

function setrenderproperty(drawing: Drawing, property: string, value: any): ()

Sets a drawing property by name.

Example
local circle = Drawing.new("Circle")

setrenderproperty(circle, "Radius", 50)
setrenderproperty(circle, "Visible", true)

print(circle.Radius)   -- Output: 50
print(circle.Visible)  -- Output: true

getrenderproperty

function getrenderproperty(drawing: Drawing, property: string): any

Returns a drawing property by name.

Example
local circle = Drawing.new("Circle")
circle.Radius = 50
circle.Visible = true

print(getrenderproperty(circle, "Radius"))    -- Output: 50
print(getrenderproperty(circle, "Visible"))   -- Output: true

cleardrawcache

function cleardrawcache(): ()

Removes every drawing object.

Example
local circle = Drawing.new("Circle")
circle.Radius = 50
circle.Color = Color3.fromRGB(255, 0, 0)
circle.Filled = true
circle.Position = Vector2.new(400, 300)
circle.Visible = true

task.wait(1)
cleardrawcache() -- every drawing object is removed

isrenderobj

function isrenderobj(object: any): boolean

Returns whether a value is a drawing object.

Example
local square = Drawing.new("Square")

print(isrenderobj(square))       -- Output: true
print(isrenderobj(workspace))    -- Output: false
print(isrenderobj("not a draw")) -- Output: false

Object properties

Common

  • Visible: boolean
  • ZIndex: number
  • Transparency: number
  • Color: Color3
  • Remove(): ()
  • Destroy(): ()

Line

  • From: Vector2
  • To: Vector2
  • Thickness: number

Text

  • Text: string
  • Font: number (0..3)
  • Size: number
  • Position: Vector2
  • Center: boolean
  • Outline: boolean
  • OutlineColor: Color3
  • TextBounds: Vector2 (read-only)

Circle

  • Radius: number
  • Position: Vector2
  • Thickness: number
  • Filled: boolean

Square

  • Size: Vector2
  • Position: Vector2
  • Thickness: number
  • Filled: boolean

Image

  • Data: string (write-only)
  • DataURL: string
  • Size: Vector2
  • Position: Vector2

Quad

  • PointA: Vector2
  • PointB: Vector2
  • PointC: Vector2
  • PointD: Vector2
  • Thickness: number

Triangle

  • PointA: Vector2
  • PointB: Vector2
  • PointC: Vector2
  • Thickness: number

Console

rconsolecreate

function rconsolecreate(): ()

Allocates and shows the console window.

Aliasesrconsoleshowconsolecreate

Example
rconsolecreate()
rconsolesettitle("Solara")
rconsoleprint("ready\n")

rconsoledestroy

function rconsoledestroy(): ()

Closes the currently allocated console window.

Aliasesrconsolehideconsoledestroy

rconsoleprint

function rconsoleprint(message: string): ()

Prints message into the console. Colour is set by printing a token first.

Aliasesconsoleprint

Colour applies to everything printed after the token, until the next one.

@@BLACK@@
@@DARK_GRAY@@
@@BLUE@@
@@LIGHT_BLUE@@
@@GREEN@@
@@LIGHT_GREEN@@
@@CYAN@@
@@LIGHT_CYAN@@
@@RED@@
@@LIGHT_RED@@
@@MAGENTA@@
@@LIGHT_MAGENTA@@
@@BROWN@@
@@YELLOW@@
@@LIGHT_GRAY@@
@@WHITE@@
Example
rconsoleprint("@@RED@@")
rconsoleprint("this is red")

rconsoleprint("@@LIGHT_GREEN@@")
rconsoleprint("and this is light green")

rconsoleprint("@@WHITE@@") -- back to white

rconsoleinfo

function rconsoleinfo(message: string): ()

Prints message into the console, with an info tag before it.

Example
rconsoleinfo("loaded 12 scripts")

rconsolewarn

function rconsolewarn(message: string): ()

Prints message into the console, with a warning tag before it.

Example
rconsolewarn("this script is deprecated")

rconsoleerr

function rconsoleerr(message: string): ()

Prints message into the console, with an error tag before it.

Example
rconsoleerr("failed to load")

rconsoleclear

function rconsoleclear(): ()

Clears the console.

Aliasesconsoleclear

rconsolesettitle

function rconsolesettitle(title: string): ()

Sets the currently allocated console title to title.

Aliasesrconsolenameconsolesettitle

Example
rconsolesettitle("Solara Console")

rconsoleinput

function rconsoleinput(): string

Yields until the user types into the console, then returns what they entered.

Aliasesrconsoleinputasyncconsoleinput

Example
rconsoleprint("name: ")
local name = rconsoleinput()
rconsoleprint("hello " .. name .. "\n")

printconsole

function printconsole(message: string, red: number?, green: number?, blue: number?): ()

Prints message to the console in an RGB colour. Omitted channels default to 0.

Example
printconsole("green text\n", 0, 255, 0)
printconsole("red text\n", 255, 0, 0)

Debug

debug.getinfo

function debug.getinfo(funcOrLevel: (...any) -> (...any) | number, options: string?): { [string]: any }

Returns information about a function or stack level. Options are s for source, f for the function itself, l for the current line, n for the name, and a for parameter counts. Upvalues are not returned.

Example
local function sample(a, b)
    return a + b
end

local info = debug.getinfo(sample)

print(info.source)      -- Output: the chunk name
print(info.short_src)   -- Output: the chunk name
print(info.func)        -- Output: function
print(info.currentline) -- Output: -1 for a Luau function
print(info.name)        -- Output: sample
print(info.numparams)   -- Output: 2
print(info.is_vararg)   -- Output: 0

-- ask for a subset
local only_name = debug.getinfo(sample, "n")
print(only_name.name)   -- Output: sample

Libraries & tables

http

Contains request.

crypt

Base64, hashing, encryption, key and byte generation, LZ4, and a zstd subtable.

crypt.base64

Contains encode and decode.

base64

Contains encode and decode.

crypt.zstd

Contains compress and decompress.

WebSocket

Contains connect. Sockets it returns expose Send, Close, OnMessage, and OnClose.

Input

LeftClick, MoveMouse, ScrollMouse, KeyPress, KeyDown, and KeyUp.

Drawing

Drawing.new and Drawing.Fonts.