APEX docs
Reference

Miscellaneous

Everything else.

appendfileasync

Also available as loadfileasync readfileasync writefileasync

The same operations as appendfile, loadfile, readfile and writefile, with the async name. They return the same results.

cansignalreplicate

Also available as getsignalwhitelist get_signal_whitelist

Returns true if a signal can be sent to the server. getsignalwhitelist lists the signals that can.

cfiresignal

Raises a signal locally from the engine's side, the same path the engine itself uses.

clearqueueonteleport

Also available as clearteleportqueue queueonteleport queueteleport clear_teleport_queue queue_on_teleport

queueonteleport saves code that runs automatically in the next game you join. clearteleportqueue discards what was saved.

crypt.generatebytes

Also available as crypt.generatekey crypt.random

Makes random data. generatebytes gives Base64 text of the length you ask for, generatekey a 32-byte Base64 key, and random raw bytes.

crypt.hash

Also available as crypt.hmac

Hashes data with the algorithm you name, and crypt.hmac computes a keyed hash. Both return the result as text.

debug.dumpcodesize

Also available as debug.dumpheap debug.dumprefs debug.getmemorycategory debug.loadmodule debug.profilebegin debug.profileend debug.resetmemorycategory debug.setmemorycategory debug.tracerefs

The game's own debug functions for memory and code size, passed through to you unchanged.

debug.info

Returns details about a function or stack level, selected by an option string.

game.GetObjects

Loads an asset by address and returns the objects inside it.

get_original_thread

Also available as oth.get_root_callback oth.hook oth.is_hook_thread oth.unhook

Returns the thread that originally made a call, from inside a hook. The oth group also has hook, unhook, is_hook_thread and get_root_callback.

getactors

Also available as get_actors

Returns the Actor objects in the game. Each Actor runs its scripts in its own parallel state.

getactorstates

Also available as get_actor_states

Returns a table for each Actor's state, so you can run code in each one.

getactorthreads

Also available as runonthread run_on_thread

Returns the threads running inside an Actor. runonthread runs a function on one of them.

getallthreads

Also available as get_all_threads

Returns every coroutine thread the game's state currently holds.

getconnectionfunction

Also available as getconnectionthread isconnectionenabled isluaconnection get_connection_function get_connection_thread is_connection_enabled is_lua_connection

Reads a field of a connection: its function, its thread, whether it is enabled, or whether it is Lua code.

getcurrentactor

Also available as get_current_actor

Returns the Actor the current code is running in, or nil if it is in the main state.

getdeletedactors

Returns markers for Actors that were removed while work was still running in them.

geteventmember

Also available as gethiddenproperties getproperties get_event_member get_hidden_properties get_properties

Returns the game's description of a member of an object, such as a property or event, by name. gethiddenproperties and getproperties return an object's properties as a table.

getexecutorname

Also available as identifyexecutor get_executor_name identify_executor

Returns two strings: the name of the executor and its version. Use it to detect which executor a script is running under.

function identifyexecutor(): (string, string)

getfpscap

Also available as setfpscap get_fps_cap set_fps_cap

Returns the frame rate limit that is set. setfpscap changes it. It reports the configured value, not the frame rate you are actually getting.

getfunctionbytecode

Returns the compiled bytecode of a Lua function. Built-in functions are refused.

gethwid

Also available as get_hwid

Returns a string that identifies this machine.

getmenv

Returns the environment of a module that has already run. It does not make one for a module that has not.

getoutputcapture

Also available as setoutputcapture

Reads, or with the set form changes, whether print and warn output is shown in Apex's console instead of the game's.

getprocessidentifier

Also available as get_process_identifier

Returns the number that identifies the game's process.

getsignalarguments

Also available as getsignalargumentsinfo get_signal_arguments get_signal_arguments_info

Returns the arguments a signal passes to its handlers, and with the info form their types and names.

hooksignal

Also available as issignalhooked restoresignal unhooksignal hook_signal is_signal_hooked restore_signal

Hooks a signal so your function runs first, with the arguments, and can change or block them. issignalhooked checks, restoresignal and unhooksignal remove it.

HttpGet

Also available as HttpGetAsync httpget httpgetasync game.HttpGet game.HttpGetAsync game.httpget game.httpgetasync http_get

Fetches a web address with GET and returns the body as a string. HttpGetAsync is the same call.

HttpPost

Also available as httppost http_post

Sends a POST request with a body and returns the response text.

httprequest

Also available as request http.request http_request

Sends an HTTP request and returns the status, headers and body. Takes a table with Url and optionally Method, Headers and Body.

type RequestOptions = {

iscustomcclosure

Also available as isnewcclosure

Returns true only for functions made by newcclosure, not for every built-in C function.

isexecutorthread

Also available as is_executor_thread

Returns true if the given thread was started by the executor, and false for the game's threads.

isfunchooked

Also available as isfunctionhooked is_function_hooked

Returns true if the function is currently hooked.

isgameactive

Also available as isrbxactive iswindowactive is_game_active is_rbx_active is_window_active

Returns true when the game window is in focus.

isgamescriptconnection

Also available as iswaitingconnection setconnectionenabled is_game_script_connection is_waiting_connection set_connection_enabled

Tells you about a connection: whether a game script made it, whether it is waiting, and lets you enable or disable it.

isnetworkowner

Also available as is_network_owner

Returns true if your client controls the physics of a part.

isuntouched

Also available as setuntouched is_un_touched set_un_touched

Reports, or with the set form changes, whether a table is marked untouched. Some scripts treat an untouched table as safe to rely on.

isvalidlevel

Also available as validlevel debug.isvalidlevel debug.validlevel is_valid_level valid_level

Returns true if a stack level exists in the current thread, so you can check before reading it.

iswritable

Also available as iswriteable is_write_able

Returns true if the table can be written to. It is the opposite of isreadonly.

makereadonly

Also available as makewritable makewriteable make_read_only make_write_able

Makes a table read-only (makereadonly) or writable (makewritable). It is setreadonly with the state fixed.

messagebox

Also available as message_box

Shows a message box with buttons and returns which button was pressed. Not every button combination is supported.

newlclosure

Also available as new_l_closure

Wraps any function in a new Lua function that forwards its arguments and results. Use it when you need a Lua closure with the same behavior.

on_actor_added

A signal that fires when a new Actor state is first seen.

on_actor_state_created

A signal that fires with the new state's table when an Actor's state has been created.

require

Loads a module and returns what it returns. Errors from the module are passed on to you.

runonactor

Also available as run_on_actor

Runs code inside an Actor's state, so the code can see that Actor's scripts and variables.

saveinstance

Also available as saveplace SaveInstanceOptions SaveInstanceOptions.new

Saves the game's objects to a file you can open in an editor. Saves a binary file by default, or XML if you set it, and accepts a list of roots to save.

setcallbackfunction

Also available as setcallbackmember setcallbackvalue set_callback_function set_callback_member set_callback_value

Sets a callback property to a function you provide.

setclipboard

Also available as toclipboard set_clipboard to_clipboard write_clipboard

Copies text to your clipboard.

setrbxclipboard

Also available as set_rbx_clipboard

Copies text to the clipboard the game uses for pasting. In Apex it currently uses the desktop clipboard.

setsimulationradius

Sets how far from the player the client controls physics. Takes a radius and an optional maximum, which defaults to the radius. Raises an error if there is no local player.

Signal.new

Also available as signal:Connect signal:Fire signal:Once signal:Wait

Creates a signal of your own. It has Connect, Once, Fire and Wait methods and delivers exactly the arguments you fire it with.