-
Notifications
You must be signed in to change notification settings - Fork 2
API ‐ Script Environment
PhoenixWhitefire edited this page Feb 14, 2026
·
3 revisions
Additional types with methods and properties
- An RGB color
- Returns a Color with the provided R, G, and B values
- Values are expected to be in the range 0 to 1
- The Blue channel
- The Green channel
- The Red channel
- A connection to an Event
- Disconnects the Connection, causing the callback to no longer be queued for resumption. May only be called once. Please note that the callback may still be invoked afterward if the Event occurred before
Disconnecting
- Whether the Connection is connected or not
- The Event which
:Connectwas called upon to return this Connection
- An Event that can be connected to
- Connect a callback to the Event
- Yields the thread until the Event is fired
- A Game Object
- Game Objects have a "base" API (properties, methods, and events) that can be extended by giving them Components
- The base API will be documented on the Component APIs page
- Finds an Object by it's internal ID. Do not rely on the ID
- Creates a new GameObject with the provided Components, such as
GameObject.new("Mesh")orGameObject.new("Model", "Animation")
- A list of all valid component names which can be passed into
.new
- A 4x4 transformation matrix
- Alias of
.fromEulerAnglesYXZ
- Creates a Matrix which has been rotated by the given Euler angles (in radians) with the rotation order X-Y-Z
- Creates a Matrix which has been rotated by the given Euler angles (in radians) with the rotation order Y-X-Z
- Creates a Matrix which has been translated to the given coordinates (specified as either a
vectoror the individual X, Y, and Z components)
- An identity matrix, the same value as what gets returned with
.new()with no arguments
- Creates a Matrix at position
Eyeoriented such that the.Forwardvector moves towardTarget
- Creates a new identity matrix when given no arguments, or a translated matrix otherwise (like
.fromTranslation)
- Extracts the orientation of the Matrix as euler angles in the YXZ rotation order
- Returns the inverse of the Matrix
- Linearly interpolates to the given Matrix
- Two Matrices may be multiplied together with the
*operator
- The value at Column 1, Row 1
- The value at Column 1, Row 2
- The value at Column 1, Row 3
- The value at Column 1, Row 4
- The value at Column 2, Row 1
- The value at Column 2, Row 2
- The value at Column 2, Row 3
- The value at Column 2, Row 4
- The value at Column 3, Row 1
- The value at Column 3, Row 2
- The value at Column 3, Row 3
- The value at Column 3, Row 4
- The value at Column 4, Row 1
- The value at Column 4, Row 2
- The value at Column 4, Row 3
- The value at Column 4, Row 4
- The Forward basis vector of the Matrix
- The position of the Matrix in world-space
- The Right basis vector of the Matrix
- The Up basis vector of the Matrix
Libraries specific to the Phoenix Engine Luau runtime (Luhx)
- Contains enumerations
- Extensions to the standard Luau
debuglibrary are documented below
- Set a breakpoint at the closest possible line to the given target line within the calling function, returning the actual line the breakpoint landed on
- If a line is not specified, breaks into Debugger immediately, and returns no values
- If a Debugger is not attached (such as in non-developer mode or headless mode), has no effect
- Interacting with the player's filesystem
- Copies the file/directory at the given path to a new path
- If unsuccessfully, throws an error message
- Returns the Current Working Directory of the Engine
- Defines an alias for the filesystem, such that
@<Alias>/refers to<For>/to the Engine
- Executes a shell command
- Returns whether the specified Path refers to a directory
- Returns whether the specified Path refers to a file
- Returns a table of all the entries in the specified directory
- The keys of the table is the path of the entry, while the values are the type of the entry
-
fis file,dis directory, andais all
- Creates a directory at the given path
- Throws an error upon failure
fs.promptopen(DefaultLocation: string? [ './' ], Filter: ( { string } | string)? [ '*.*' ], FilterName: string? [ 'All files' ], AllowMultipleFiles: boolean? [ false ]): { string }
- Prompts the player to select a file to open
- Returns the list of files the player selected, or an empty list if the player cancelled the dialog
- If the operation fails, returns
nilinstead
- Prompts the user to select a folder
- Returns
nilif no selection was made
fs.promptsave(DefaultLocation: string? [ './' ], Filter: ( { string } | string)? [ '*.*' ], FilterName: string? [ 'All files' ]): string?
- Prompts the player to select a path to save a file to
- Returns the path the player selected, or
nilif they cancelled the dialog
- Reads the file at the given address, and returns the contents
- If the file could not be read, returns
niland an error message
- Removes everything at the given path
- Throws an error upon failure
- Renames the file at the given
Pathto have theNewName - Throws an error upon failure
fs.resolvepath(Path: string) -> string* Resolves the aliases of the path, converting it into the form ./path or leaving it as another qualified variant
fs.resolvepathabsolute(Path: string) -> string* Same asfs.resolvepath, however converts path in the CWD-relative form (./path) to be absolute (relative to system root directory)
- Changes the meaning of non-qualified paths (e.g.: not beginning with
.orC:etc) to act as aliases to the given path +resources/instead of referring to the CWD
- Overwrites/creates the file at
Pathwith the providedContents - Throws an error upon failure
- If
CreateDirectoriesistrue, will automatically create missing intermediate directories to the file
- UI with Dear ImGui
ImGui::IsAnyItemActive
imgui.begin(WindowTitle: string, WindowFlags: string? [ "" ], HasCloseButton: boolean? [ false ]): boolean, boolean
ImGui::Begin-
WindowFlagsmay be a combination of any of the following sequences, optionally separated by ' ' or '|' characters:nt(no titlebar),nr(no resize),nm(no move),nc(no collapse),ns(no saved settings),ni(no interact),h(horizontal scrolling)
imgui.beginchild(Name: string, Width: number? [ 0 ], Height: number? [ 0 ], ChildFlags: string? [ "" ], WindowFlags: string? [ "" ]): boolean
ImGui::BeginChild-
ChildFlagsmay be a combination of any of the following sequences, optionally separated by ' ' or '|' characters:b(borders),wp(always use window padding),rx(resize X),ry(resize Y),ax(auto resize X),ay(auto resize Y),f(frame style) -
WindowFlagsmay be a combination of any of the following sequences, optionally separated by ' ' or '|' characters:nt(no titlebar),nr(no resize),nm(no move),nc(no collapse),ns(no saved settings),ni(no interact),h(horizontal scrolling)
- Creates a Dear ImGui window which takes up the entire screen
ImGui::BeginMainMenuBar
ImGui::BeginMenu
ImGui::BeginMenuBar
ImGui::BeginPopup
ImGui::BeginPopupModal
ImGui::Button
ImGui::Checkbox
ImGui::CloseCurrentPopup
-
ImGui::Combo. Returns the selected option index
ImGui::GetContentRegionAvail
- Returns the current position of the Dear ImGui element cursor within the current window
- To set the cursor position, use
.setcursorposition
- Renders the Dear ImGui demo window (
ImGui::ShowDemoWindow)
ImGui::Dummy
ImGui::EndChild
ImGui::EndMainMenuBar
ImGui::EndMenu
ImGui::EndMenuBar
ImGui::EndPopup
-
ImGui::End,endwand notendbecauseendis a Luau keyword
imgui.image(ImagePath: string, Size: vector?, FlipVertically: boolean? [ false ], TintColor: { number }? [ { 1, 1, 1, 1 } ], DoBilinearSmoothing: boolean? [ true ]):
ImGui::Image
ImGui::ImageButton
ImGui::Indent
ImGui::InputDouble
ImGui::InputText
ImGui::IsItemClicked
ImGui::IsItemHovered
ImGui::MenuItem
ImGui::OpenPopup
ImGui::PopID
ImGui::PopStyleColor
ImGui::PushID
ImGui::PushStyleColor-
Coloris an array with 4 numbers representing R, G, B, and A
ImGui::SameLine
ImGui::SetScrollHereY
ImGui::Separator
ImGui::SeparatorText
- Sets the position of the Dear ImGui element cursor within the current window
ImGui::SetItemTooltip
- Sets the width of the next item
ImGui::SetNextItemWidth
ImGui::SetNextWindowFocus
ImGui::SetNextWindowCollapsed(!Open)
- `ImGui::SetNextWindowPos
ImGui::SetNextWindowSize
ImGui::SetTooltip
- Sets the region of the window in which Dear ImGui windows can be docked
- Reverts the region of the window in which Dear ImGui windows can be docked to the default settings
-
ImGui::StyleColorsDark/ImGui::StyleColorsLight
ImGui::Text
ImGui::TextLink
ImGui::CalcTextSize
ImGui::TreeNode- Accepts flags:
sl- Selected,sc- Span All Columns,fr- Framed,fw- Span Full Width,ao- Allow Overlap,ar- Open on Arrow,aw- Span Available Width,np- No Tree Push On Open,do- Default Open,dc- Open On Double Click,dlx- Draw Lines None,dln- Draw Lines to Nodes,dlf- Draw Lines Full,lf- Leaf,lw- Span Label Width,lsc- Span All Columns,b- Bullet,p- Frame Padding,c- Collapsing Header.and|are considered whitespace
ImGui::TreePop
- Similar to
imgui.textlink, however, will open the given URL upon being clicked -
Urlwill beTextif not provided ImGui::TextLinkOpenUrl
ImGui::IsWindowHovered
- Returns the position of the current Dear ImGui window (
ImGui::GetWindowPos) - To set the position of the window, use
.setnextwindowposition
- Returns the size of the current window
- Encoding and decoding JSON files
- Encodes the provided value into a JSON string. The default indentiation is 2 spaces
- Decodes the JSON string and returns it as a value
- Scheduling of tasks (coroutines or functions)
- Schedules the given function or coroutine to be resumed at the next scheduler step
- Schedules the given function or coroutine to be resumed some number of seconds later
- Like
loadstringin other runtimes, however does not compromise Global Import optimizations and returns a coroutine instead of a function - If an error occurs, returns
nilas the first value and the error message as the second value
- Similar to
loadthread, however loads from a file instead of from a string directly
- Yields the thread for the specified number of seconds. Default is
0
Additional global variables
- A non-unique identifier for the current Luau VM
- Same as
print, but does not prefix the log message with[INFO]
- The GameObject acting as the Data Model of the Engine
- Same as
print, except generates a Warning message
- Shorthand for
game.Workspace