table getrawmetatable(variant<table, userdata> obj)
Returns the metatable from a table or userdata, even if it is locked.
boolean setrawmetatable(variant<table, userdata> obj, table val)
Sets the metatable of a table or userdata, even if it is locked.
boolean isreadonly(table val)
Returns true if the table is read-only.
boolean setreadonly(table tab, boolean readonly)
Sets the read-only flag of a table.
boolean printconsole(string val [, number r, number g, number b])
Prints val
to Elysian’s console with color r
, g
, b
. Default color is 0, 0, 200.
boolean printdebug(string val)
Prints val
to the console (View->Console->Toggle)
string content)
Internal function used by DataModel::GetObjects (see init.lua)
string readfile(string filename)
Returns the contents of a file in the workspace folder
function loadfile(string filename)
Loads a file from the workspace folder. Returns nil and an error on error. Similar to executing loadstring(readfile(filename))
.
table getgenv()
Returns the global environment for Elysian.
table getrenv()
Returns the global environment for game scripts.
boolean Clipboard.set(string data)
Sets the contents of the clipboard to data
.
void mouse1press([number x, number y])
Presses the left mouse button.
void mouse1release([number x, number y])
Releases the left mouse button.
void mouse1click([number delay, number x, number y])
Clicks the left mouse button with an optional delay in between press and release. Delay default is ~0.03 seconds.
void mouse2press([number x, number y])
Presses the right mouse button.
void mouse2release([number x, number y])
Releases the right mouse button.
void mouse2click([number delay, number x, number y])
Clicks the right mouse button with an optional delay in between press and release. Delay default is ~0.03 seconds.
void keypress(KeyCode key)
Presses a key. If a number is passed for key
, Elysian will interpret it as a virtual key code and attempt to convert it to a KeyCode for compatibility with scripts created for older versions of Elysian.
void keyrelease(KeyCode key)
Releases a key. If a number is passed for key
, Elysian will interpret it as a virtual key code. See keypress.
void mousemove(number x, number y [, number dx, number dy])
Moves the cursor to a location inside Roblox’s window. dx
and dy
are optional mouse delta parameters to be sent to Roblox. If not provided, they are equivalent to x - current_mouse_position.X
and y - current_mouse_position.Y
respectively.
void mousemoverel(number dx, number dy)
Moves the cursor relatively.
void mousescroll(boolean forward [, number x, number y])
Scrolls the mouse. For compatibility with scripts created for older versions of Elysian, a number can be passed to forward
where a positive number scrolls the mouse up, a negative number scrolls the mouse down, and one scroll “click” is equal to 120.
boolean writefile(string filename, string data [, boolean binary])
Writes data to a file in the workspace folder. Returns true if successful.
boolean appendfile(string filename, string data [, boolean binary])
Appends data to a file in the workspace folder. Returns true if successful.
boolean mkdir(string path)
Creates a directory in the workspace folder. Returns true if successful.
void saveinstance(variant<Instance, table> instance, string name [, table options])
Saves an instance to a file in the workspace folder which can be later opened in Roblox Studio. Possible options (and their default values) can be seen below:
DefaultSettings = {
DecompileMode = 0, -- 0 = don't decompile scripts, 1 = Synapse X Decompiler
NilInstances = false, -- save nil instances
RemovePlayerCharacters = true, -- ignore players' characters
SavePlayers = false, -- saves players and their descendants
DecompileTimeout = 10, -- process timeout
MaxThreads = 3, -- the max number of processes that should be running at one time (the higher this value is the faster the decompilation process)
DecompileIgnore = {"Chat","CoreGui","CorePackages"}, -- scripts inside these services are saved but not decompiled
ShowStatus = true, -- whether to show status text
IgnoreDefaultProps = true,
IsolateStarterPlayer = true -- allows for playing the game in studio right after opening
}
instance
can be a table of instances to save multiple instances at once.
void saveplace(string name [, table options])
Equivalent to saveinstance(game, name, options)
boolean decompile(variant<Instance, function> script, function callback(string result, string error), number timeout = 5)
Attempts to decompile script
. If invalid parameters are passed, nil and an error is returned. If not, decompile returns with true and a (Windows) thread is created that spawns an external process and waits for its output. Once the process ends, the callback is called with the result. If the process is unable to start or another error occurs, the callback is called with nil and the error. WARNING: A new process is created every time this function is called. Calling decompile too quickly or in excessive amounts may cause some processes to hang or exhaust your computer of resources.
boolean checkcaller()
Returns true if the function calling the function calling checkcaller is an Elysian function.
boolean setfflag(string fflag, string value)
Sets an FFlag’s value. Returns true if the flag was set succesfully or false if the flag doesn’t exist. For more information on FFlags and how to retrieve their values, see: http://wiki.roblox.com/index.php?title=API:Class/GlobalSettings/GetFFlag
table getreg()
Returns Lua’s registry (LUA_REGISTRYINDEX).
table getnilinstances()
Returns a list of nil instances.
void elysianexecute(string script [, Instance localscript])
Equivalent to executing a script through Elysian’s interface (pressing the execute button, etc). If localscript
is provided, the script will be binded/linked to that instance. If not present, a new LocalScript will be created.
function newcclosure(function f)
Disguises Lua function f
as a C function. It is seen as a C function by other scripts and any errors thrown inside f
are viewed as coming from the C function, not f
(in other words, the existence of f
can not be detected by viewing the error message, stack trace, or etc.). f
is allowed to yield ( e.g. wait() ) but will resume outside of the function.
function replaceclosure(function target, function replacement)
Replaces a function with another function and returns a clone of the original. Once a function is replaced it cannot be replaced with any other function except for its clone/original. For a better understanding, see this code. Warning: It should be noted that Lua doesn’t like people modifying internal structures and improper or extensive use of this function may cause unexpected crashes or other issues.
boolean restoreclosure(function target)
Restores a closure that has been overwritten with replaceclosure. Returns false if the function has not been replaced.
functions: bit.tobit, bit.tohex, bit.bnot, bit.band, bit.bor, bit.bxor, bit.lshift, bit.rshift, bit.arshift, bit.rol, bit.ror
Attempts to replicate LuaJIT’s bit library.
table getallthreads()
Returns an array of all existing Lua threads.
Instance getthreadobject([thread t])
Returns the script associated with a Lua thread. If t
is not provided, the current thread is used.
table gettenv([thread t])
Returns a thread’s environment. If t
is not provided, the current thread is used.
table getsenv(Instance script)
Searches for a thread associated with script
and returns its environment (see init.lua for implementation).
table getlocals(number level)
Returns a Lua function’s local variables. The level parameter represents a function on the callstack, where 1 is the function calling getlocals, 2 is the function calling that function, and so on. The level provided cannot point to an Elysian or C function.
In Luau-enabled games, getlocals returns the function’s stack as an array instead of a dictionary of local names to local variables.
boolean setlocal(number level, string i, variant v)
Sets local variable i
to value v
in the function pointed to by level
(see getlocals). Like getlocals, the function cannot be an Elysian or C function. Returns true if the variable was set successfully.
In Luau-enabled games, setlocal requires an integer index for i
instead of a string.
table getupvals(variant<number, function> f)
Returns a Lua function’s upvalues. If a number is passed for f
, it is interpreted as a level (see getlocals and setlocal). The function cannot be an Elysian or C function.
In Luau-enabled games, getupvals returns the function’s upvalues as an array instead of a dictionary of upvalue names to upvalues.
boolean setupval(variant<number, function> f, string i, variant v)
Sets upvalue i
to value v
in function f
. If a number is passed for f
, it is interpreted as a level (see getlocals and setlocal). The function cannot be an Elysian or C function. Returns true if the upvalue was set successfully.
In Luau-enabled games, setupval requires an integer index for i
instead of a string.
table getconsts(variant<number, function> f)
Returns a Lua function’s constants. If a number is passed for f
, it is interpreted as a level.
void setconst(variant<number, function> f, number i, variant v)
Sets constant number i
to value v
in function f
. If a number is passed for f
, it is interpreted as a level.
table getgc([boolean nomt])
Returns an array of all existing allocated objects in Lua. This includes strings, functions, threads, userdata, and more across all Roblox and Elysian scripts. Unless nomt
is set, the returned table has a metatable with __mode set to “v”.
boolean islclosure(function f)
Returns true if f
is a Lua function.
Instance gethui()
Returns a hidden renderable container separate from CoreGui, PlayerGui, and et cetera. ScreenGuis and Messages parented to this container will render on top of CoreGui. Although parented to Game, game scripts cannot enumerate Game’s children to find this container or use functions such as FindFirstChild to find the container or any of its descendants. Objects added to and removed from the container will not fire DescendantAdded or DescendantRemoving signals on Game.
string getbspval(Instance object, string property [, boolean base64])
Reads a BinaryString property’s value. Useful for reading conventionally unreadable BinaryString properties such as Terrain.SmoothGrid, PartOperation.PhysicsData, BinaryStringValue.Value, and so on.
variant getnspval(Instance object, string property)
Returns a property’s value, even if it is unscriptable.
string getpcd(Instance union)
Returns a 16-byte hash and binary data corresponding to TriangleMeshPart’s PhysicalConfigData property.
Instance cloneref(Instance ref)
Clones a reference to an instance. clone==ref
will be false, but both values will point to the same instance.
string md5sum(string data)
Returns the MD5 sum of data
.
string base64encode(string data)
Returns data
base64-encoded.
string base64decode(string data)
Returns data
base64-decoded.
string getunionassetid(Instance union)
Equivalent to getnspval(union, "AssetId")
table getconnections(RBXScriptSignal signal)
Returns a list of Lua and engine connections to signal
.
boolean isluau()
Returns true if the game is running on Roblox’s new Lua implementation, Luau.
string getnamecallmethod()
Returns the method parameter in the context of a __namecall metamethod. Only applies to Luau-enabled games. See init.lua for example usage.
string getelyasset([string name])
Returns a string in the format rbxasset://<random_string>/<name>
that can be used with Content properties to load custom assets from the workspace folder.
Drawable Drawing.new(string type)
Creates a new drawable object. type
must be “Circle”, “Box”, “Line”, or “Text”. See below for more information.
table Drawing:GetObjects()
Returns a list of all drawable objects.
int Drawing.DefaultFont
A value between 1 and 21, inclusive. Default 21
.
boolean Drawing.UseCompatTransparency
If true, 0
will indicate transparency and 1
will indicate opaqueness when setting a drawable’s Transparency
property.
string ClassName [readonly]
The type of drawable.
Vector2 Position
The position of the drawable. A position of (0, 0) marks the top left corner of the screen.
Color3 Color
The color of the drawable.
boolean Visible
The drawable’s visibility.
int ZIndex
The drawable’s layer. This number can be 0 to 25. Drawables on higher layers will render over drawables on lower layers.
float Transparency
A value from 0 to 1. A value of 1 means the drawable is completely transparent.
void Drawable:Destroy()
Destroys a drawable. Further access to the object will throw an error.
void Drawable:Remove()
Equivalent to drawable:Destroy()
Drawable Drawable:Clone()
Constructs a new drawable with equal properties.
float Radius
The circle’s radius.
int Segments
The number of segments that make up the circle. Default 20
.
boolean Filled
Whether or not the circle is filled. Default false
.
float Thickness
The circle’s thickness. Applies only when Filled
is false
.
Vector2 Size
The box’s size.
float Rounding
The roundness of the box’s corners. Default 0
.
boolean Filled
Whether or not the box is filled. Default false
.
float Thickness
The box’s thickness. Applies only when Filled
is false
.
Vector2 EndPosition
The line’s end position.
float Thickness
The line’s thickness.
float FontSize
Font size.
string Text
The string to display.
float WrapWidth
If greater than 0, the maximum width, in pixels, before text is wrapped. Default 0
.
int Font
A value between 0 and 21, inclusive. A value of 0 indicates a default font controlled by the Drawing.DefaultFont
property. Fonts for values 1 to 20 can be found here.
Vector2 TextBounds [readonly]
The width and height of the text.
boolean Outline
Indicates whether the text is outlined.
Color3 OutlineColor
The outline’s color.
Luau is a custom, speedy Lua implementation created by Roblox. It was first spotted in early April of 2019 before being publicly announced by Roblox in late June. Luau does not change Lua’s syntax or behavior but implements a much faster runtime using optimizations in the parser and virtual machine.
boolean Scriptable [readonly]
Determines whether or not a signal is scriptable. Calling Connect or Wait on non-scriptable signals has no effect.
RBXScriptConnection RBXScriptSignal:Connect(function func)
In Elysian, Connect works as normal but can also register connections to non-scriptable signals. A list of non-scriptable/internal signals will appear here in the future.
table RBXScriptSignal:GetConnections()
Equivalent to getconnections(signal)
boolean LuaConnection [readonly]
Determines whether or not the connection is attached to a Lua function.
boolean Enabled
Determines whether or not the connection is enabled. Disabled connections will not fire. Both Lua and engine connections can be disabled. Anti-AFK can now by achieved with a few lines of code:
for i, v in pairs(game:GetService"Players".LocalPlayer.Idled:GetConnections()) do
if not v.LuaConnection then
v.Enabled = false
end
end
This works by disabling a connection created by Roblox’s engine responsible for kicking the client when the user has been idle for more than 20 minutes.
function RBXScriptConnection:GetFunction()
Returns a connection’s associated Lua function or nil if the connection is not a Lua connection or the function belongs to another Lua instance (corescript state, etc.)
void RBXScriptConnection:GetThread()
Returns a connection’s associated Lua thread or nil if the connection is not a Lua connection or the thread belongs to another Lua instance (corescript state, etc.)