Documentation of Electron

string decompile(LocalScript/ModuleScript)
� Decompile a given LocalScript/ModuleScript and return the decompiled output

bool IsElectron
� Check if Electron is loaded

void createconsole(title)
� Creates new console with title

void closeconsole(void)
� Closes current console

bool checkcaller(void)
� Return true if current thread was not called from game script

string getscripthash(LocalScript/ModuleScript)
� Return bytecode hashed with SHA384, You can use this function to check if LocalScript/ModuleScript is changed

table getgenv(void)
� Returns global environment in a table

table getrenv(void)
� Returns Roblox's environment in a table

table getreg(void)
� Returns Roblox's lua registry in a table

table getgc(bool)
� Returns Roblox's gc functions/table in a table

table getallgc(void)
� Returns Roblox's gc objects in a table

table getflags(void)
� Returns loaded fflags in a table

table getsenv( LocalScript/ModuleScript )
� Returns the script's environment in a table

string getclipboard(void)
� Returns whatever is copied on the clipboard as a string

table getrawmetatable(variant)
� Returns metatable of variant, returns nil is there is no metatable

int getthreadcontext(void)
� Return current thread identity

table getinstances(void)
� Return all instances in game and return table

variant gethiddenproperty(Instance, Property)
� Get hidden property

table gethiddenproperties(Instance)
� Get all hidden properties from Instance and return table

function getscriptfunction( LocalScript/ModuleScript )
� Returns registry function of the given script

table getloadedmodules(void)
� Return loaded modules in table

userdata getcallingscript(void)
� Return script from current thread, return nil if its from Electron

table getnilinstances(void)
� Returns instances which the parent is nil

string getnamecallmethod(void)
� Returns current namecall method name

bool isloadedmodule(ModuleScript)
� Check if the modulescript is already loaded or not

bool iscclosure(function)
� Returns whether or not a function is a C function

bool islclosure(function)
� Returns whether or not a function is a Lua function

bool isreadonly(variant)
� Return variant readonly value

bool iselectronfunction(function)
� Check if function is from Electron

void sethiddenproperty(Instance, Property, variant)
� Set hidden property

void setrawmetatable(variant, table)
� Set current variant metatable to argument

void setnamecallmethod(string)
� Set current namecall method name

void setreadonly(variant, bool)
� Set variant readonly value

void setthreadcontext(int)
� Set current thread identity

void setsimulationradius(int SimulationRadius, int MaxSimulationRadius?)
� Set current thread identity

void setscriptable(Instance, Property Name, bool abletoindex?)
� Set the instance's hidden property so it can be indexed

void setclipboard( ... )
� Sets clipboard data to all given arguments

bool setfflag(FlagName, Value)
� Set fflag to value and return true if exist

function newcclosure(function)
� Creates c closure that invoke function argument when gets called

function loadstring(script, chunk?)
� Compile the script and return function

variant require(ModuleScript)
� Returns the value from ModuleScript

void fireclickdetector(ClickDetector)
� Fire's ClickDetector

void firetouchinterest(Part TargetTouch, Part ToTouch, Number Toggle)
� Fire touched event on TargetTouch with ToTouch part, Toggle must be either 0 (fire) or 1 (unfire)

void writeconsole( ... )
� Writes ... to the current console

void mousemoverel(int x, int y)
� Moves mouse position to x and y

void keypress(int keycode)
� Presses virtual keycode: find codes here

void keyrelease(int keycode)
� Releases keycode

string lz4compress(string input)
� Compress the input with lz4 compression algorithm

string lz4decompress(string input)
� Decompress the input with lz4 compression algorithm

string base64encode(string input)
� Encode the string using base64 format

string base64decode(string input)
� Decode the base64 input to normal string

File System

void appendfile(filename, content)
� Append content to filename inside workspace folder

void writefile(filename, content)
� Writes content to the workspace folder, named filename

string readfile(filename)
� Returns content of filename from workspace folder

table listfiles(path)
� Return a list of files from path inside workspace folder

void makefolder(foldername)
� Create foldername inside workspace folder

bool isfolder(foldername)
� Check if foldername exist inside workspace folder

bool isfile(filename)
� Check if filename exist inside workspace folder

bool delfile(filename)
� Try delete filename inside workspace folder, and return true if succeed

bool delfolder(foldername)
� Try delete foldername inside workspace folder, and return true if succeed

Debug Library

table debug.getconstants(function)
� Returns constants from lua function

variant debug.getstack(level, [optional] idx)
� Return stack from level as table, if has idx it will return something

table debug.getmetatable(variant)
� Returns metatable from variant and without getting locked

table debug.getregistry(void)
� Return Roblox's lua registry table

table debug.getupvalues(function)
� Return function upvalues

variant debug.getupvalue(function, int index)
� Return upvalue from upvalue index function

table debug.getprotos(function)
� Return functions/proto from function

function debug.getproto(function, int index, bool SearchGC?)
� Return functions/proto from index, If searchgc set to true it will search the proto instances in gc and it will return table!

table debug.getfenv(variant)
� Return variant environment

table debug.getinfo(function)
� Return info from function

void debug.setconstant(function, int index, variant value)
� Set constant from constant index to value

void debug.setupvalue(function, int index, variant value)
� Set upvalue from upvalue index to value

bool debug.setmetatable(variant, table)
� Set variant metatable

void debug.setstack(level, idx, value)
� Set stack from level on idx to value