Other APIs
Files, JSON, networking, settings, screenshots, and everything else.
Globals
| Name | Type | Description |
|---|---|---|
Enum |
ENUM_LIST |
Enum
Class
Methods
| Method | Description |
|---|---|
GetEnumItems |
GetEnumItems
Returns: { any }
EnumItem
Class
Properties
| Property | Type | Description |
|---|---|---|
Name |
string |
|
Value |
number |
|
EnumType |
Enum |
Methods
| Method | Description |
|---|---|
IsA |
IsA
Parameters
| Name | Type |
|---|---|
enumName |
string |
Returns: boolean
EnumTextJustify_INTERNAL
Class · inherits from Enum
Properties
| Property | Type | Description |
|---|---|---|
Left |
TextJustify |
|
Center |
TextJustify |
|
Right |
TextJustify |
|
InvariantLeft |
TextJustify |
|
InvariantRight |
TextJustify |
|
ETextJustify_MAX |
TextJustify |
SpectatorEmote
Class · inherits from EnumItem
EnumSpectatorEmote_INTERNAL
Class · inherits from Enum
Properties
| Property | Type | Description |
|---|---|---|
None |
SpectatorEmote |
|
Affirmative |
SpectatorEmote |
|
Negative |
SpectatorEmote |
|
Left |
SpectatorEmote |
|
Right |
SpectatorEmote |
|
Up |
SpectatorEmote |
|
Down |
SpectatorEmote |
|
Wave |
SpectatorEmote |
|
XX |
SpectatorEmote |
|
Wink |
SpectatorEmote |
|
Suspicious |
SpectatorEmote |
|
ESpectatorEmote_MAX |
SpectatorEmote |
LuauFile
Class
File I/O for camera scripts, scoped to the calling script's package folder.
Static functions
| Method | Description |
|---|---|
saveText |
Writes a UTF-8 text file inside the calling script's package folder. |
saveBytes |
Writes an array of bytes (each in [0, 255]) to a file. |
loadTexture |
Loads and decodes an image file. |
loadText |
Reads a UTF-8 text file from within the calling script's package folder. |
loadBytes |
Reads a binary file and returns its bytes as a 1-indexed table of values in [0, 255]. |
listFiles |
Lists all files inside the calling script's package folder recursively. Pass "" to list the whole package, or a relative subfolder to list just that folder. |
saveText
Writes a UTF-8 text file inside the calling script's package folder.
Parameters
| Name | Type |
|---|---|
Path |
string |
Contents |
string |
Returns: boolean
saveBytes
Writes an array of bytes (each in [0, 255]) to a file.
Parameters
| Name | Type |
|---|---|
Path |
string |
Bytes |
Array<number> |
Returns: boolean
loadTexture
Loads and decodes an image file.
Parameters
| Name | Type |
|---|---|
Path |
string |
Returns: LuauTexture?
loadText
Reads a UTF-8 text file from within the calling script's package folder.
Parameters
| Name | Type |
|---|---|
Path |
string |
Returns: string
loadBytes
Reads a binary file and returns its bytes as a 1-indexed table of values in [0, 255].
Parameters
| Name | Type |
|---|---|
Path |
string |
Returns: Array<number>
listFiles
Lists all files inside the calling script's package folder recursively. Pass "" to list the whole package, or a relative subfolder to list just that folder.
Parameters
| Name | Type |
|---|---|
Path |
string |
Returns: Array<string>
LuauJson
Class
JSON parsing and serialization for camera scripts.
Static functions
| Method | Description |
|---|---|
serialize |
Serializes a table (object or array) to a JSON string. Values may be tables, numbers, strings or booleans; anything else makes the whole serialize fail and return an empty string. |
parse |
Parses a JSON string. Objects and arrays become tables, null becomes nil. Returns nil if the text is not valid JSON. |
serialize
Serializes a table (object or array) to a JSON string. Values may be tables, numbers, strings or booleans; anything else makes the whole serialize fail and return an empty string.
Parameters
| Name | Type | Description |
|---|---|---|
Value |
Ref |
|
Pretty |
boolean |
Multi-line indented output instead of condensed. |
Returns: string
parse
Parses a JSON string. Objects and arrays become tables, null becomes nil. Returns nil if the text is not valid JSON.
Parameters
| Name | Type |
|---|---|
Text |
string |
Returns: Ref
ModuleStateSpectatorLuaApi
Class
Module State Spectator Lua Api
Properties
| Property | Type | Description |
|---|---|---|
transform |
Transform |
This actual value is never used, only as a proxy for allowing the getter to work |
Methods
| Method | Description |
|---|---|
getTeamScore |
Gets the current score for the specified team |
getTeamRoundsWon |
Gets the number of round wins for the specified team |
getTeamColorsArray |
Get Team Colors Array |
getStringConfigVariable |
Get String Config Variable |
getSlotId |
Get Slot Id |
getNumberConfigVariable |
Get Number Config Variable |
getIsGameRunning |
Get Is Game Running |
getGameTimeComponent |
Returns an object that contains game time information |
getBoolConfigVariable |
Get Bool Config Variable |
getTeamScore
Gets the current score for the specified team
Parameters
| Name | Type | Description |
|---|---|---|
TeamIndex |
number |
Which team to get the score for. 0-indexed. |
Returns: number
getTeamRoundsWon
Gets the number of round wins for the specified team
Parameters
| Name | Type | Description |
|---|---|---|
TeamIndex |
number |
Which team to get the score for. 0-indexed. |
Returns: number
getTeamColorsArray
Get Team Colors Array
Returns: Array<TeamColor>
getStringConfigVariable
Get String Config Variable
Parameters
| Name | Type |
|---|---|
VariableName |
string |
Returns: string
getSlotId
Get Slot Id
Returns: string
getNumberConfigVariable
Get Number Config Variable
Parameters
| Name | Type |
|---|---|
VariableName |
string |
Returns: number
getIsGameRunning
Get Is Game Running
Returns: boolean
getGameTimeComponent
Returns an object that contains game time information
Returns: SpectatorGameTimeComponent?
getBoolConfigVariable
Get Bool Config Variable
Parameters
| Name | Type |
|---|---|
VariableName |
string |
Returns: boolean
Screenshot
Class
Screenshot
Static functions
| Method | Description |
|---|---|
takeScreenshot |
Takes a high-res screenshot at a given resolution. Screenshots are saved to Documents/Another-Axiom/A2/Screenshots |
takeScreenshot
Takes a high-res screenshot at a given resolution. Screenshots are saved to Documents/Another-Axiom/A2/Screenshots
Parameters
| Name | Type | Description |
|---|---|---|
Width |
number |
Width of the screenshot in pixels |
Height |
number |
Height of the screenshot in pixels |
Returns: string
Settings
Class
Change game settings from within luau
Static functions
| Method | Description |
|---|---|
mutePlayerByName |
Mute a player by name |
getLuauReplayControlAllowed |
Returns true if the user has enabled the option to control replays from luau |
mutePlayerByName
Mute a player by name
Parameters
| Name | Type |
|---|---|
PlayerName |
string |
bShouldMute |
boolean |
Returns: boolean
getLuauReplayControlAllowed
Returns true if the user has enabled the option to control replays from luau
Returns: boolean
Network
Class
Utility functions for managing connections to game servers
Static functions
| Method | Description |
|---|---|
getCurrentServer |
Returns the name of the station we are currently connected to. Returns an empty string if not connected. |
disconnectFromServer |
Disconnects from the current server if connected. Returns true on success, false otherwise. |
connectToServer |
Connect to a game server using the given station name |
getCurrentServer
Returns the name of the station we are currently connected to. Returns an empty string if not connected.
Returns: string
disconnectFromServer
Disconnects from the current server if connected. Returns true on success, false otherwise.
Returns: boolean
connectToServer
Connect to a game server using the given station name
Parameters
| Name | Type |
|---|---|
StationName |
string |
Returns: boolean