# Table of Contents - [Console | Potassium API](#console-potassium-api) - [Crypt | Potassium API](#crypt-potassium-api) - [Metatable | Potassium API](#metatable-potassium-api) - [Web Sockets | Potassium API](#web-sockets-potassium-api) - [Actor | Potassium API](#actor-potassium-api) - [File System | Potassium API](#file-system-potassium-api) - [Scripts | Potassium API](#scripts-potassium-api) - [Closures | Potassium API](#closures-potassium-api) - [Cache | Potassium API](#cache-potassium-api) - [Input | Potassium API](#input-potassium-api) - [Drawing | Potassium API](#drawing-potassium-api) - [Miscellaneous | Potassium API](#miscellaneous-potassium-api) - [Debug | Potassium API](#debug-potassium-api) - [Instance | Potassium API](#instance-potassium-api) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Cache | Potassium API](#cache-potassium-api) --- # Console | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/console.md) . rconsoleclear[](https://potassium.gitbook.io/api/environment/console#rconsoleclear) ------------------------------------------------------------------------------------ Copy rconsoleclear() Clears the output of the console window. * * * rconsolecreate[](https://potassium.gitbook.io/api/environment/console#rconsolecreate) -------------------------------------------------------------------------------------- Copy rconsolecreate() ~Opens the console window. Text previously output to the console will not be cleared.~ ⚠️ This function is disabled. * * * rconsoledestroy[](https://potassium.gitbook.io/api/environment/console#rconsoledestroy) ---------------------------------------------------------------------------------------- Copy rconsoledestroy() Clears the output of the console window. * * * rconsoleinput[](https://potassium.gitbook.io/api/environment/console#rconsoleinput) ------------------------------------------------------------------------------------ Copy rconsoleinput() ~Waits for the user to input text into the console window. Returns the result.~ ⚠️ This function is disabled. * * * rconsoleprint[](https://potassium.gitbook.io/api/environment/console#rconsoleprint) ------------------------------------------------------------------------------------ Prints `text` to the console window. Does not clear existing text or create a new line. * * * rconsolewarn[](https://potassium.gitbook.io/api/environment/console#rconsolewarn) ---------------------------------------------------------------------------------- Prints `text` as a warning to the console window. Does not clear existing text or create a new line. * * * rconsoleerror[](https://potassium.gitbook.io/api/environment/console#rconsoleerror) ------------------------------------------------------------------------------------ Prints `text` as an error to the console window. Does not clear existing text or create a new line. * * * rconsolesettitle[](https://potassium.gitbook.io/api/environment/console#rconsolesettitle) ------------------------------------------------------------------------------------------ ~Sets the title of the console window to~ `~title~`~.~ ⚠️ This function is disabled. * * * [PreviousClosures](https://potassium.gitbook.io/api/environment/closures) [NextCrypt](https://potassium.gitbook.io/api/environment/crypt) Last updated 1 year ago * [rconsoleclear](https://potassium.gitbook.io/api/environment/console#rconsoleclear) * [rconsolecreate](https://potassium.gitbook.io/api/environment/console#rconsolecreate) * [rconsoledestroy](https://potassium.gitbook.io/api/environment/console#rconsoledestroy) * [rconsoleinput](https://potassium.gitbook.io/api/environment/console#rconsoleinput) * [rconsoleprint](https://potassium.gitbook.io/api/environment/console#rconsoleprint) * [rconsolewarn](https://potassium.gitbook.io/api/environment/console#rconsolewarn) * [rconsoleerror](https://potassium.gitbook.io/api/environment/console#rconsoleerror) * [rconsolesettitle](https://potassium.gitbook.io/api/environment/console#rconsolesettitle) Copy rconsoleprint( text) Copy rconsolewarn( text) Copy rconsoleerror( text) Copy rconsolesettitle( title) --- # Crypt | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/crypt.md) . crypt.base64encode[](https://potassium.gitbook.io/api/environment/crypt#crypt.base64encode) -------------------------------------------------------------------------------------------- Copy crypt.base64encode( data) Encodes a string of bytes into Base64. * * * crypt.base64decode[](https://potassium.gitbook.io/api/environment/crypt#crypt.base64decode) -------------------------------------------------------------------------------------------- Copy crypt.base64decode( data) Decodes a Base64 string to a string of bytes. * * * crypt.encrypt[](https://potassium.gitbook.io/api/environment/crypt#crypt.encrypt) ---------------------------------------------------------------------------------- Copy crypt.encrypt( data, key, iv, mode) Encrypts an unencoded string using AES encryption. Returns the base64 encoded and encrypted string, and the IV. If an AES IV is not provided, a random one will be generated for you, and returned as a 2nd base64 encoded string. The cipher modes are 'CBC', 'ECB', 'CTR', 'CFB', 'OFB', and 'GCM'. The default is 'CBC'. * * * crypt.decrypt[](https://potassium.gitbook.io/api/environment/crypt#crypt.decrypt) ---------------------------------------------------------------------------------- Decrypts the base64 encoded and encrypted content. Returns the raw string. The cipher modes are 'CBC', 'ECB', 'CTR', 'CFB', 'OFB', and 'GCM'. * * * crypt.generatebytes[](https://potassium.gitbook.io/api/environment/crypt#crypt.generatebytes) ---------------------------------------------------------------------------------------------- Generates a random sequence of bytes of the given size. Returns the sequence as a base64 encoded string. * * * crypt.generatekey[](https://potassium.gitbook.io/api/environment/crypt#crypt.generatekey) ------------------------------------------------------------------------------------------ Generates a base64 encoded 256-bit key. The result can be used as the second parameter for the `crypt.encrypt` and `crypt.decrypt` functions. * * * crypt.hash[](https://potassium.gitbook.io/api/environment/crypt#crypt.hash) ---------------------------------------------------------------------------- Returns the result of hashing the data using the given algorithm. Some algorithms include 'sha1', 'sha384', 'sha512', 'md5', 'sha256', 'sha3-224', 'sha3-256', and 'sha3-512'. * * * [PreviousConsole](https://potassium.gitbook.io/api/environment/console) [NextDebug](https://potassium.gitbook.io/api/environment/debug) Last updated 1 year ago * [crypt.base64encode](https://potassium.gitbook.io/api/environment/crypt#crypt.base64encode) * [crypt.base64decode](https://potassium.gitbook.io/api/environment/crypt#crypt.base64decode) * [crypt.encrypt](https://potassium.gitbook.io/api/environment/crypt#crypt.encrypt) * [crypt.decrypt](https://potassium.gitbook.io/api/environment/crypt#crypt.decrypt) * [crypt.generatebytes](https://potassium.gitbook.io/api/environment/crypt#crypt.generatebytes) * [crypt.generatekey](https://potassium.gitbook.io/api/environment/crypt#crypt.generatekey) * [crypt.hash](https://potassium.gitbook.io/api/environment/crypt#crypt.hash) Copy crypt.encrypt( data, key, iv, mode) Copy crypt.generatebytes( size) Copy crypt.generatekey() Copy crypt.hash( data, algo) --- # Metatable | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/metatable.md) . getrawmetatable[](https://potassium.gitbook.io/api/environment/metatable#getrawmetatable) ------------------------------------------------------------------------------------------ Copy getrawmetatable(
object) Returns the metatable of `object`, where the `__metatable` field would normally lock the metatable. * * * hookmetamethod[](https://potassium.gitbook.io/api/environment/metatable#hookmetamethod) ---------------------------------------------------------------------------------------- Copy hookmetamethod(
object, method, hook) Replaces `func` with `hook` internally, where `hook` will be invoked in place of `func` when called. Returns a new function that can be used to access the original definition of `func`. * * * getnamecallmethod[](https://potassium.gitbook.io/api/environment/metatable#getnamecallmethod) ---------------------------------------------------------------------------------------------- Copy getnamecallmethod() Returns the name of the method that invoked the `__namecall` metamethod. * * * setnamecallmethod[](https://potassium.gitbook.io/api/environment/metatable#setnamecallmethod) ---------------------------------------------------------------------------------------------- Copy setnamecallmethod( method) Changes the name of the method that invoked `__namecall` metamethod. * * * isreadonly[](https://potassium.gitbook.io/api/environment/metatable#isreadonly) -------------------------------------------------------------------------------- Returns whether `object` is read-only or not. * * * setrawmetatable[](https://potassium.gitbook.io/api/environment/metatable#setrawmetatable) ------------------------------------------------------------------------------------------ Sets the metatable of `object` to `metatable`, where the `__metatable` field would normally lock the metatable. * * * setreadonly[](https://potassium.gitbook.io/api/environment/metatable#setreadonly) ---------------------------------------------------------------------------------- Sets whether `object` is read-only or not. * * * makewriteable[](https://potassium.gitbook.io/api/environment/metatable#makewriteable) -------------------------------------------------------------------------------------- Unfreezes `object` . * * * makereadonly[](https://potassium.gitbook.io/api/environment/metatable#makereadonly) ------------------------------------------------------------------------------------ Freezes `object` , where table.freeze would normally check for \_\_metatable. * * * [PreviousInstance](https://potassium.gitbook.io/api/environment/instance) [NextMiscellaneous](https://potassium.gitbook.io/api/environment/miscellaneous) Last updated 1 year ago * [getrawmetatable](https://potassium.gitbook.io/api/environment/metatable#getrawmetatable) * [hookmetamethod](https://potassium.gitbook.io/api/environment/metatable#hookmetamethod) * [getnamecallmethod](https://potassium.gitbook.io/api/environment/metatable#getnamecallmethod) * [setnamecallmethod](https://potassium.gitbook.io/api/environment/metatable#setnamecallmethod) * [isreadonly](https://potassium.gitbook.io/api/environment/metatable#isreadonly) * [setrawmetatable](https://potassium.gitbook.io/api/environment/metatable#setrawmetatable) * [setreadonly](https://potassium.gitbook.io/api/environment/metatable#setreadonly) * [makewriteable](https://potassium.gitbook.io/api/environment/metatable#makewriteable) * [makereadonly](https://potassium.gitbook.io/api/environment/metatable#makereadonly) Copy isreadonly(
object) Copy setrawmetatable(
object,
metatable) Copy setreadonly(
object, readonly) Copy makewriteable(
object) Copy makereadonly(
object) --- # Web Sockets | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/web-sockets.md) . WebSocket.connect[](https://potassium.gitbook.io/api/environment/web-sockets#websocket.connect) ------------------------------------------------------------------------------------------------ Copy WebSocket.connect( url) Establishes a WebSocket connection to the specified URL. Copy local ws = WebSocket.connect("ws://localhost:8080") ws.OnMessage:Connect(function(message) print(message) end) ws.OnClose:Connect(function() print("Closed") end) ws:Send("Hello, World!") * * * WebSocketConnection[](https://potassium.gitbook.io/api/environment/web-sockets#websocketconnection) ---------------------------------------------------------------------------------------------------- Copy ws = WebSocket.connect(url) ### Methods[](https://potassium.gitbook.io/api/environment/web-sockets#methods) Method Description Sends a message over the WebSocket connection Closes the WebSocket connection ### Events[](https://potassium.gitbook.io/api/environment/web-sockets#events) Event Description Fired when a message is received over the WebSocket connection Fired when the WebSocket connection is closed * * * [PreviousScripts](https://potassium.gitbook.io/api/environment/scripts) [NextActor](https://potassium.gitbook.io/api/environment/actor) Last updated 1 year ago * [WebSocket.connect](https://potassium.gitbook.io/api/environment/web-sockets#websocket.connect) * [WebSocketConnection](https://potassium.gitbook.io/api/environment/web-sockets#websocketconnection) * [Methods](https://potassium.gitbook.io/api/environment/web-sockets#methods) * [Events](https://potassium.gitbook.io/api/environment/web-sockets#events) Copy Send( message) Copy Close() Copy OnMessage( message) Copy OnClose() --- # Actor | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/actor.md) . create\_comm\_channel[](https://potassium.gitbook.io/api/environment/actor#create_comm_channel) ------------------------------------------------------------------------------------------------ Copy create_comm_channel() Returns the channel and the associated ID. * * * get\_comm\_channel[](https://potassium.gitbook.io/api/environment/actor#get_comm_channel) ------------------------------------------------------------------------------------------ Copy get_comm_channel( id) Returns the communication channel if it exists. * * * run\_on\_actor[](https://potassium.gitbook.io/api/environment/actor#run_on_actor) ---------------------------------------------------------------------------------- Copy run_on_actor( actor, script, ...) Runs a script on an actor thread. Copy run_on_actor(getactors()[1], [[\ print("Hello, world!")\ ]]) * * * getactors[](https://potassium.gitbook.io/api/environment/actor#getactors) -------------------------------------------------------------------------- Returns a table of all actors that exist within the game. * * * is\_parallel[](https://potassium.gitbook.io/api/environment/actor#is_parallel) ------------------------------------------------------------------------------- Returns if the thread is running on an actor. * * * run\_on\_thread[](https://potassium.gitbook.io/api/environment/actor#run_on_thread) ------------------------------------------------------------------------------------ Runs a script on a specified thread, actor threads only. * * * getactorthreads[](https://potassium.gitbook.io/api/environment/actor#getactorthreads) -------------------------------------------------------------------------------------- Returns all threads that belong to actors in a table. * * * [PreviousWeb Sockets](https://potassium.gitbook.io/api/environment/web-sockets) Last updated 1 year ago * [create\_comm\_channel](https://potassium.gitbook.io/api/environment/actor#create_comm_channel) * [get\_comm\_channel](https://potassium.gitbook.io/api/environment/actor#get_comm_channel) * [run\_on\_actor](https://potassium.gitbook.io/api/environment/actor#run_on_actor) * [getactors](https://potassium.gitbook.io/api/environment/actor#getactors) * [is\_parallel](https://potassium.gitbook.io/api/environment/actor#is_parallel) * [run\_on\_thread](https://potassium.gitbook.io/api/environment/actor#run_on_thread) * [getactorthreads](https://potassium.gitbook.io/api/environment/actor#getactorthreads) Copy > getactors() Copy is_parallel() Copy run_on_thread( thread, script, ...) Copy run_on_thread(getactorthreads()[1], [[\ print("Hello, world!")\ ]]) Copy > getactorthreads() --- # File System | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/file-system.md) . readfile[](https://potassium.gitbook.io/api/environment/file-system#readfile) ------------------------------------------------------------------------------ Copy readfile( path) Returns the contents of the file located at `path`. * * * listfiles[](https://potassium.gitbook.io/api/environment/file-system#listfiles) -------------------------------------------------------------------------------- Copy > listfiles( path) Returns a list of files and folders in the folder located at `path`. The returned list contains whole paths. * * * writefile[](https://potassium.gitbook.io/api/environment/file-system#writefile) -------------------------------------------------------------------------------- Copy writefile( path, data) Writes `data` to the file located at `path` if it is not a folder. * * * makefolder[](https://potassium.gitbook.io/api/environment/file-system#makefolder) ---------------------------------------------------------------------------------- Copy makefolder( path) Creates a folder at `path` if it does not already exist. * * * appendfile[](https://potassium.gitbook.io/api/environment/file-system#appendfile) ---------------------------------------------------------------------------------- Appends `data` to the end of the file located at `path`. Creates the file if it does not exist. * * * isfile[](https://potassium.gitbook.io/api/environment/file-system#isfile) -------------------------------------------------------------------------- Returns whether or not `path` points to a file. * * * isfolder[](https://potassium.gitbook.io/api/environment/file-system#isfolder) ------------------------------------------------------------------------------ Returns whether or not `path` points to a folder. * * * delfile[](https://potassium.gitbook.io/api/environment/file-system#delfile) ---------------------------------------------------------------------------- Removes the file located at `path`. * * * delfolder[](https://potassium.gitbook.io/api/environment/file-system#delfolder) -------------------------------------------------------------------------------- Removes the folder located at `path`. * * * loadfile[](https://potassium.gitbook.io/api/environment/file-system#loadfile) ------------------------------------------------------------------------------ Generates a chunk from the file located at `path`. The environment of the returned function is the global environment. If there are no compilation errors, the chunk is returned by itself; otherwise, it returns `nil` plus the error message. `chunkname` is used as the chunk name for error messages and debug information. * * * dofile[](https://potassium.gitbook.io/api/environment/file-system#dofile) -------------------------------------------------------------------------- Attempts to load the file located at `path` and execute it on a new thread. * * * [PreviousDrawing](https://potassium.gitbook.io/api/environment/drawing) [NextInput](https://potassium.gitbook.io/api/environment/input) Last updated 1 year ago * [readfile](https://potassium.gitbook.io/api/environment/file-system#readfile) * [listfiles](https://potassium.gitbook.io/api/environment/file-system#listfiles) * [writefile](https://potassium.gitbook.io/api/environment/file-system#writefile) * [makefolder](https://potassium.gitbook.io/api/environment/file-system#makefolder) * [appendfile](https://potassium.gitbook.io/api/environment/file-system#appendfile) * [isfile](https://potassium.gitbook.io/api/environment/file-system#isfile) * [isfolder](https://potassium.gitbook.io/api/environment/file-system#isfolder) * [delfile](https://potassium.gitbook.io/api/environment/file-system#delfile) * [delfolder](https://potassium.gitbook.io/api/environment/file-system#delfolder) * [loadfile](https://potassium.gitbook.io/api/environment/file-system#loadfile) * [dofile](https://potassium.gitbook.io/api/environment/file-system#dofile) Copy appendfile( path, data) Copy isfile( path) Copy isfolder( path) Copy delfile( path) Copy delfolder( path) Copy loadfile( path, chunkname) Copy dofile( path) --- # Scripts | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/scripts.md) . getgc[](https://potassium.gitbook.io/api/environment/scripts#getgc) -------------------------------------------------------------------- Copy > getgc( includetables) Returns a list of objects in the Luau garbage collector. If `includeTables` is false, tables will not be included in the list. * * * getgenv[](https://potassium.gitbook.io/api/environment/scripts#getgenv) ------------------------------------------------------------------------ Copy > getgenv() Returns the custom global environment of the executor. * * * gettenv[](https://potassium.gitbook.io/api/environment/scripts#gettenv) ------------------------------------------------------------------------ Copy gettenv( thread) Returns the environment of `thread`. * * * getreg[](https://potassium.gitbook.io/api/environment/scripts#getreg) ---------------------------------------------------------------------- Copy > getreg() Returns the lua registry. * * * getloadedmodules[](https://potassium.gitbook.io/api/environment/scripts#getloadedmodules) ------------------------------------------------------------------------------------------ Returns a list of ModuleScripts that have been loaded. * * * getrenv[](https://potassium.gitbook.io/api/environment/scripts#getrenv) ------------------------------------------------------------------------ Returns the global environment of the game client. It can be used to access the global functions that LocalScripts and ModuleScripts use. * * * getrunningscripts[](https://potassium.gitbook.io/api/environment/scripts#getrunningscripts) -------------------------------------------------------------------------------------------- Returns a list of scripts that are currently running. * * * getscriptbytecode[](https://potassium.gitbook.io/api/environment/scripts#getscriptbytecode) -------------------------------------------------------------------------------------------- Returns the raw Luau bytecode of the given script. * * * getscriptclosure[](https://potassium.gitbook.io/api/environment/scripts#getscriptclosure) ------------------------------------------------------------------------------------------ Generates a new closure using the bytecode of `script`. * * * getscripthash[](https://potassium.gitbook.io/api/environment/scripts#getscripthash) ------------------------------------------------------------------------------------ Returns a SHA384 hash of the script's bytecode. * * * getscripts[](https://potassium.gitbook.io/api/environment/scripts#getscripts) ------------------------------------------------------------------------------ Returns a list of every script in the game. * * * getsenv[](https://potassium.gitbook.io/api/environment/scripts#getsenv) ------------------------------------------------------------------------ Returns the global environment of the given script. It can be used to access variables and functions that are not defined as local. * * * getthreadidentity[](https://potassium.gitbook.io/api/environment/scripts#getthreadidentity) -------------------------------------------------------------------------------------------- Returns the identity of the current thread. * * * setthreadidentity[](https://potassium.gitbook.io/api/environment/scripts#setthreadidentity) -------------------------------------------------------------------------------------------- Sets the current thread identity. * * * [PreviousMiscellaneous](https://potassium.gitbook.io/api/environment/miscellaneous) [NextWeb Sockets](https://potassium.gitbook.io/api/environment/web-sockets) Last updated 1 year ago * [getgc](https://potassium.gitbook.io/api/environment/scripts#getgc) * [getgenv](https://potassium.gitbook.io/api/environment/scripts#getgenv) * [gettenv](https://potassium.gitbook.io/api/environment/scripts#gettenv) * [getreg](https://potassium.gitbook.io/api/environment/scripts#getreg) * [getloadedmodules](https://potassium.gitbook.io/api/environment/scripts#getloadedmodules) * [getrenv](https://potassium.gitbook.io/api/environment/scripts#getrenv) * [getrunningscripts](https://potassium.gitbook.io/api/environment/scripts#getrunningscripts) * [getscriptbytecode](https://potassium.gitbook.io/api/environment/scripts#getscriptbytecode) * [getscriptclosure](https://potassium.gitbook.io/api/environment/scripts#getscriptclosure) * [getscripthash](https://potassium.gitbook.io/api/environment/scripts#getscripthash) * [getscripts](https://potassium.gitbook.io/api/environment/scripts#getscripts) * [getsenv](https://potassium.gitbook.io/api/environment/scripts#getsenv) * [getthreadidentity](https://potassium.gitbook.io/api/environment/scripts#getthreadidentity) * [setthreadidentity](https://potassium.gitbook.io/api/environment/scripts#setthreadidentity) Copy > getloadedmodules() Copy > getrenv() Copy > getrunningscripts() Copy getscriptbytecode( script) Copy getscriptclosure( script) Copy getscripthash( script) Copy > getscripts() Copy > getsenv( script) Copy getthreadidentity() Copy setthreadidentity( identity) --- # Closures | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/closures.md) . checkcaller[](https://potassium.gitbook.io/api/environment/closures#checkcaller) --------------------------------------------------------------------------------- Copy checkcaller() Returns whether the function currently running was called by the executor. This is useful for metamethod hooks that behave differently when called by the game. * * * clonefunction[](https://potassium.gitbook.io/api/environment/closures#clonefunction) ------------------------------------------------------------------------------------- Copy clonefunction( func) Generates a new closure based on the bytecode of function `func`. Copy local function foo() print("Hello, world!") end local bar = clonefunction(foo) foo() --> Hello, world! bar() --> Hello, world! print(foo == bar) --> false * * * getcallingscript[](https://potassium.gitbook.io/api/environment/closures#getcallingscript) ------------------------------------------------------------------------------------------- Returns the script responsible for the currently running function. * * * hookfunction[](https://potassium.gitbook.io/api/environment/closures#hookfunction) ----------------------------------------------------------------------------------- Replaces `func` with `hook` internally, where `hook` will be invoked in place of `func` when called. Returns a new function that can be used to access the original definition of `func`. If `func` is a Luau function (`islclosure(func) --> true`), the upvalue count of `hook` must be less than or equal to that of `func`. [Lua visibility rules](http://www.lua.org/manual/5.1/manual.html#2.6) * * * iscclosure[](https://potassium.gitbook.io/api/environment/closures#iscclosure) ------------------------------------------------------------------------------- Returns whether or not `func` is a closure whose source is written in C. * * * islclosure[](https://potassium.gitbook.io/api/environment/closures#islclosure) ------------------------------------------------------------------------------- Returns whether or not `func` is a closure whose source is written in Luau. * * * isexecutorclosure[](https://potassium.gitbook.io/api/environment/closures#isexecutorclosure) --------------------------------------------------------------------------------------------- Returns whether or not `func` was created by the executor. * * * loadstring[](https://potassium.gitbook.io/api/environment/closures#loadstring) ------------------------------------------------------------------------------- Generates a chunk from the given source code. The environment of the returned function is the global environment. If there are no compilation errors, the chunk is returned by itself; otherwise, it returns `nil` plus the error message. `chunkname` is used as the chunk name for error messages and debug information. * * * newcclosure[](https://potassium.gitbook.io/api/environment/closures#newcclosure) --------------------------------------------------------------------------------- Returns a C closure that wraps `func`. The result is functionally identical to `func`, but identifies as a C closure. * * * [PreviousCache](https://potassium.gitbook.io/api) [NextConsole](https://potassium.gitbook.io/api/environment/console) Last updated 1 year ago * [checkcaller](https://potassium.gitbook.io/api/environment/closures#checkcaller) * [clonefunction](https://potassium.gitbook.io/api/environment/closures#clonefunction) * [getcallingscript](https://potassium.gitbook.io/api/environment/closures#getcallingscript) * [hookfunction](https://potassium.gitbook.io/api/environment/closures#hookfunction) * [iscclosure](https://potassium.gitbook.io/api/environment/closures#iscclosure) * [islclosure](https://potassium.gitbook.io/api/environment/closures#islclosure) * [isexecutorclosure](https://potassium.gitbook.io/api/environment/closures#isexecutorclosure) * [loadstring](https://potassium.gitbook.io/api/environment/closures#loadstring) * [newcclosure](https://potassium.gitbook.io/api/environment/closures#newcclosure) Copy getcallingscript() Copy hookfunction( func, hook) Copy local function foo() print("Hello, world!") end local fooRef = hookfunction(foo, function(...) print("Hooked!") end) foo() --> Hooked! fooRef() --> Hello, world! Copy iscclosure( func) Copy islclosure( func) Copy isexecutorclosure( func) Copy loadstring( source, chunkname) Copy newcclosure( func) Copy local foo = function() return true end local bar = newcclosure(foo) print(bar()) --> true --- # Cache | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/cache.md) . cache.invalidate[](https://potassium.gitbook.io/api#cache.invalidate) ---------------------------------------------------------------------- Copy cache.invalidate( object) Deletes `object` from the Instance cache. Effectively invalidates `object` as a reference to the underlying Instance. * * * cache.iscached[](https://potassium.gitbook.io/api#cache.iscached) ------------------------------------------------------------------ Copy cache.iscached( object) Checks whether `object` exists in the Instance cache. * * * cache.replace[](https://potassium.gitbook.io/api#cache.replace) ---------------------------------------------------------------- Copy cache.replace( object, newobject) Replaces `object` in the Instance cache with `newObject`. * * * cloneref[](https://potassium.gitbook.io/api#cloneref) ------------------------------------------------------ Copy cloneref( object) Returns a copy of the Instance reference to `object`. This is useful for managing an Instance without directly referencing it. * * * compareinstances[](https://potassium.gitbook.io/api#compareinstances) ---------------------------------------------------------------------- Returns whether objects `a` and `b` both reference the same Instance. * * * [NextClosures](https://potassium.gitbook.io/api/environment/closures) Last updated 1 year ago * [cache.invalidate](https://potassium.gitbook.io/api#cache.invalidate) * [cache.iscached](https://potassium.gitbook.io/api#cache.iscached) * [cache.replace](https://potassium.gitbook.io/api#cache.replace) * [cloneref](https://potassium.gitbook.io/api#cloneref) * [compareinstances](https://potassium.gitbook.io/api#compareinstances) Copy compareinstances( a, b) --- # Input | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/input.md) . isrbxactive[](https://potassium.gitbook.io/api/environment/input#isrbxactive) ------------------------------------------------------------------------------ Copy isrbxactive() Returns whether the game's window is in focus. Must be true for other input functions to work. * * * mouse1click[](https://potassium.gitbook.io/api/environment/input#mouse1click) ------------------------------------------------------------------------------ Copy mouse1click() Dispatches a left mouse button click. * * * mouse1press[](https://potassium.gitbook.io/api/environment/input#mouse1press) ------------------------------------------------------------------------------ Copy mouse1press() Dispatches a left mouse button press. * * * mouse1release[](https://potassium.gitbook.io/api/environment/input#mouse1release) ---------------------------------------------------------------------------------- Copy mouse1release() Dispatches a left mouse button release. * * * mouse2click[](https://potassium.gitbook.io/api/environment/input#mouse2click) ------------------------------------------------------------------------------ Dispatches a right mouse button click. * * * mouse2press[](https://potassium.gitbook.io/api/environment/input#mouse2press) ------------------------------------------------------------------------------ Dispatches a right mouse button press. * * * mouse2release[](https://potassium.gitbook.io/api/environment/input#mouse2release) ---------------------------------------------------------------------------------- Dispatches a right mouse button release. * * * mousemoveabs[](https://potassium.gitbook.io/api/environment/input#mousemoveabs) -------------------------------------------------------------------------------- Moves the mouse cursor to the specified absolute position. * * * mousemoverel[](https://potassium.gitbook.io/api/environment/input#mousemoverel) -------------------------------------------------------------------------------- Adjusts the mouse cursor by the specified relative amount. * * * mousescroll[](https://potassium.gitbook.io/api/environment/input#mousescroll) ------------------------------------------------------------------------------ Dispatches a mouse scroll by the specified number of pixels. * * * [PreviousFile System](https://potassium.gitbook.io/api/environment/file-system) [NextInstance](https://potassium.gitbook.io/api/environment/instance) Last updated 1 year ago * [isrbxactive](https://potassium.gitbook.io/api/environment/input#isrbxactive) * [mouse1click](https://potassium.gitbook.io/api/environment/input#mouse1click) * [mouse1press](https://potassium.gitbook.io/api/environment/input#mouse1press) * [mouse1release](https://potassium.gitbook.io/api/environment/input#mouse1release) * [mouse2click](https://potassium.gitbook.io/api/environment/input#mouse2click) * [mouse2press](https://potassium.gitbook.io/api/environment/input#mouse2press) * [mouse2release](https://potassium.gitbook.io/api/environment/input#mouse2release) * [mousemoveabs](https://potassium.gitbook.io/api/environment/input#mousemoveabs) * [mousemoverel](https://potassium.gitbook.io/api/environment/input#mousemoverel) * [mousescroll](https://potassium.gitbook.io/api/environment/input#mousescroll) Copy mouse2click() Copy mouse2press() Copy mouse2release() Copy mousemoveabs( x, y) Copy mousemoverel( x, y) Copy mousescroll( pixels) --- # Drawing | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/drawing.md) . Drawing.new[](https://potassium.gitbook.io/api/environment/drawing#drawing.new) -------------------------------------------------------------------------------- Copy Drawing.new( type) Create a new drawing object of the specified type. Objects[](https://potassium.gitbook.io/api/environment/drawing#objects) DrawingObject[](https://potassium.gitbook.io/api/environment/drawing#drawingobject) ------------------------------------------------------------------------------------ ### BaseDrawingObject[](https://potassium.gitbook.io/api/environment/drawing#basedrawingobject) Property Type Visible boolean ZIndex number Transparency number Color Color3 Destroy function ### Line[](https://potassium.gitbook.io/api/environment/drawing#line) Property Type From Vector2 To Vector2 Thickness number ### Text[](https://potassium.gitbook.io/api/environment/drawing#text) Property Type Text string TextBounds Vector2 Font number Size number Position Vector2 Center boolean Outline boolean OutlineColor Color3 ### Image[](https://potassium.gitbook.io/api/environment/drawing#image) Property Type Data string Size Vector2 Position Vector2 Rounding number ### Circle[](https://potassium.gitbook.io/api/environment/drawing#circle) Property Type NumSides number Radius number Position Vector2 Thickness number Filled boolean ### Square[](https://potassium.gitbook.io/api/environment/drawing#square) Property Type Size Vector2 Position Vector2 Thickness number Filled boolean ### Quad[](https://potassium.gitbook.io/api/environment/drawing#quad) Property Type PointA Vector2 PointB Vector2 PointC Vector2 PointD Vector2 Thickness number Filled boolean ### Triangle[](https://potassium.gitbook.io/api/environment/drawing#triangle) Property Type PointA Vector2 PointB Vector2 PointC Vector2 Thickness number Filled boolean * * * Drawing.Fonts[](https://potassium.gitbook.io/api/environment/drawing#drawing.fonts) ------------------------------------------------------------------------------------ Index Value UI 0 System 1 Plex 2 Monospace 3 * * * cleardrawcache[](https://potassium.gitbook.io/api/environment/drawing#cleardrawcache) -------------------------------------------------------------------------------------- Copy cleardrawcache() Destroys every drawing object in the cache. Invalidates references to the drawing objects. * * * getrenderproperty[](https://potassium.gitbook.io/api/environment/drawing#getrenderproperty) -------------------------------------------------------------------------------------------- Gets the value of a property of a drawing. Functionally identical to `drawing[property]`. * * * isrenderobj[](https://potassium.gitbook.io/api/environment/drawing#isrenderobj) -------------------------------------------------------------------------------- Returns whether the given object is a valid Drawing. * * * setrenderproperty[](https://potassium.gitbook.io/api/environment/drawing#setrenderproperty) -------------------------------------------------------------------------------------------- Sets the value of a property of a drawing. Functionally identical to `drawing[property] = value`. * * * [PreviousDebug](https://potassium.gitbook.io/api/environment/debug) [NextFile System](https://potassium.gitbook.io/api/environment/file-system) Last updated 1 year ago * [Drawing.new](https://potassium.gitbook.io/api/environment/drawing#drawing.new) * [Drawing.Fonts](https://potassium.gitbook.io/api/environment/drawing#drawing.fonts) * [cleardrawcache](https://potassium.gitbook.io/api/environment/drawing#cleardrawcache) * [getrenderproperty](https://potassium.gitbook.io/api/environment/drawing#getrenderproperty) * [isrenderobj](https://potassium.gitbook.io/api/environment/drawing#isrenderobj) * [setrenderproperty](https://potassium.gitbook.io/api/environment/drawing#setrenderproperty) Copy getrenderproperty( drawing, property) Copy isrenderobj( object) Copy setrenderproperty( drawing, property, value) --- # Miscellaneous | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/miscellaneous.md) . identifyexecutor[](https://potassium.gitbook.io/api/environment/miscellaneous#identifyexecutor) ------------------------------------------------------------------------------------------------ Copy identifyexecutor() Returns the name and version of Potassium. * * * lz4compress[](https://potassium.gitbook.io/api/environment/miscellaneous#lz4compress) -------------------------------------------------------------------------------------- Copy lz4compress( data) Compresses `data` using LZ4 compression. * * * lz4decompress[](https://potassium.gitbook.io/api/environment/miscellaneous#lz4decompress) ------------------------------------------------------------------------------------------ Copy lz4compress( data, size) Decompresses `data` using LZ4 compression, with the decompressed size specified by `size`. * * * messagebox[](https://potassium.gitbook.io/api/environment/miscellaneous#messagebox) ------------------------------------------------------------------------------------ Copy messagebox( text, caption, flags) Creates a message box with the specified text, caption, and flags. Yields until the message box is closed, and returns the user input code. * * * * * * queue\_on\_teleport[](https://potassium.gitbook.io/api/environment/miscellaneous#queue_on_teleport) ---------------------------------------------------------------------------------------------------- Queues the specified script to be executed after the player teleports to a different place. * * * request[](https://potassium.gitbook.io/api/environment/miscellaneous#request) ------------------------------------------------------------------------------ Sends an HTTP request using the specified options. Yields until the request is complete, and returns the response. Field Type Description Url string The URL for the request. Method string The HTTP method to use. Body string? The body of the request. Headers table? A table of headers. Cookies table? A table of cookies. * * * getinternalparent[](https://potassium.gitbook.io/api/environment/miscellaneous#getinternalparent) -------------------------------------------------------------------------------------------------- Returns the internal parent field of the `instance`. * * * getfflag[](https://potassium.gitbook.io/api/environment/miscellaneous#getfflag) -------------------------------------------------------------------------------- Returns the value of `fflag` * * * setfflag[](https://potassium.gitbook.io/api/environment/miscellaneous#setfflag) -------------------------------------------------------------------------------- Sets the value of `fflag` to `value` * * * setinternalparent[](https://potassium.gitbook.io/api/environment/miscellaneous#setinternalparent) -------------------------------------------------------------------------------------------------- Sets the internal parent field of `instance` to `newparent` * * * setclipboard[](https://potassium.gitbook.io/api/environment/miscellaneous#setclipboard) ---------------------------------------------------------------------------------------- Copies `text` to the clipboard. * * * setfpscap[](https://potassium.gitbook.io/api/environment/miscellaneous#setfpscap) ---------------------------------------------------------------------------------- Sets the in-game FPS cap to `fps`. If `fps` is 0, the FPS cap is disabled. * * * [PreviousMetatable](https://potassium.gitbook.io/api/environment/metatable) [NextScripts](https://potassium.gitbook.io/api/environment/scripts) Last updated 1 year ago * [identifyexecutor](https://potassium.gitbook.io/api/environment/miscellaneous#identifyexecutor) * [lz4compress](https://potassium.gitbook.io/api/environment/miscellaneous#lz4compress) * [lz4decompress](https://potassium.gitbook.io/api/environment/miscellaneous#lz4decompress) * [messagebox](https://potassium.gitbook.io/api/environment/miscellaneous#messagebox) * [queue\_on\_teleport](https://potassium.gitbook.io/api/environment/miscellaneous#queue_on_teleport) * [request](https://potassium.gitbook.io/api/environment/miscellaneous#request) * [getinternalparent](https://potassium.gitbook.io/api/environment/miscellaneous#getinternalparent) * [getfflag](https://potassium.gitbook.io/api/environment/miscellaneous#getfflag) * [setfflag](https://potassium.gitbook.io/api/environment/miscellaneous#setfflag) * [setinternalparent](https://potassium.gitbook.io/api/environment/miscellaneous#setinternalparent) * [setclipboard](https://potassium.gitbook.io/api/environment/miscellaneous#setclipboard) * [setfpscap](https://potassium.gitbook.io/api/environment/miscellaneous#setfpscap) Copy queue_on_teleport( code) Copy request( options) Copy getinternalparent( instance) Copy getfflag( fflag) Copy setfflag( fflag, value) Copy setinternalparent( instance, newparent) Copy setclipboard( text) Copy setfpscap( fps) --- # Debug | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/debug.md) . debug.isvalidlevel[](https://potassium.gitbook.io/api/environment/debug#debug.isvalidlevel) -------------------------------------------------------------------------------------------- Copy debug.isvalidlevel( level) Returns whether `level` is a valid level or not. * * * debug.getregistry[](https://potassium.gitbook.io/api/environment/debug#debug.getregistry) ------------------------------------------------------------------------------------------ Copy > debug.getregistry() Returns the lua registry. * * * debug.getconstant[](https://potassium.gitbook.io/api/environment/debug#debug.getconstant) ------------------------------------------------------------------------------------------ Copy debug.getconstant( func, index) Returns the constant at `index` in the constant table of the function or level `func`. Throws an error if the constant does not exist. * * * debug.getconstants[](https://potassium.gitbook.io/api/environment/debug#debug.getconstants) -------------------------------------------------------------------------------------------- Copy > debug.getconstants( func) Returns the constant table of the function or level `func`. * * * debug.getinfo[](https://potassium.gitbook.io/api/environment/debug#debug.getinfo) ---------------------------------------------------------------------------------- Returns debugger information about a function or stack level. #### DebugInfo[](https://potassium.gitbook.io/api/environment/debug#debuginfo) Field Type Description `source` string The name of the chunk that created the function. `short_src` string A "printable" version of `source` to be used in error messages. `func` function The function itself. `what` string The string "Lua" if the function is a Luau function, or "C" if it is a C function. `currentline` number The current line where the given function is executing. `name` string The name of the function. `nups` number The number of upvalues in the function. `numparams` number The number of parameters in the function. `is_vararg` number Whether the function has a variadic argument. * * * debug.getproto[](https://potassium.gitbook.io/api/environment/debug#debug.getproto) ------------------------------------------------------------------------------------ Returns the proto at `index` in the function or level `func` if `active` is false. If `active` is true, then every active function of the proto is returned. * * * debug.getprotos[](https://potassium.gitbook.io/api/environment/debug#debug.getprotos) -------------------------------------------------------------------------------------- Returns a list of protos of the function or level `func`. * * * debug.getstack[](https://potassium.gitbook.io/api/environment/debug#debug.getstack) ------------------------------------------------------------------------------------ Returns the value at `index` in the stack frame `level`. Throws an error if no value could be found. If `index` is not specified, then the entire stack frame is returned. * * * debug.getupvalue[](https://potassium.gitbook.io/api/environment/debug#debug.getupvalue) ---------------------------------------------------------------------------------------- Returns the upvalue at `index` in the function or level `func`. Throws an error if the upvalue does not exist. An upvalue is a local variable used by an inner function, and is also called an _external local variable_. Read more on [Lua visibility rules](http://www.lua.org/manual/5.1/manual.html#2.6) . * * * debug.getupvalues[](https://potassium.gitbook.io/api/environment/debug#debug.getupvalues) ------------------------------------------------------------------------------------------ Returns a list of upvalues of the function or level `func`. * * * debug.setconstant[](https://potassium.gitbook.io/api/environment/debug#debug.setconstant) ------------------------------------------------------------------------------------------ Sets the constant at `index` in the function or level `func` to `value`. * * * debug.setstack[](https://potassium.gitbook.io/api/environment/debug#debug.setstack) ------------------------------------------------------------------------------------ Sets the register at `index` in the stack frame `level` to `value`. * * * debug.setupvalue[](https://potassium.gitbook.io/api/environment/debug#debug.setupvalue) ---------------------------------------------------------------------------------------- Sets the upvalue at `index` in the function or level `func` to `value`. * * * [PreviousCrypt](https://potassium.gitbook.io/api/environment/crypt) [NextDrawing](https://potassium.gitbook.io/api/environment/drawing) Last updated 1 year ago * [debug.isvalidlevel](https://potassium.gitbook.io/api/environment/debug#debug.isvalidlevel) * [debug.getregistry](https://potassium.gitbook.io/api/environment/debug#debug.getregistry) * [debug.getconstant](https://potassium.gitbook.io/api/environment/debug#debug.getconstant) * [debug.getconstants](https://potassium.gitbook.io/api/environment/debug#debug.getconstants) * [debug.getinfo](https://potassium.gitbook.io/api/environment/debug#debug.getinfo) * [debug.getproto](https://potassium.gitbook.io/api/environment/debug#debug.getproto) * [debug.getprotos](https://potassium.gitbook.io/api/environment/debug#debug.getprotos) * [debug.getstack](https://potassium.gitbook.io/api/environment/debug#debug.getstack) * [debug.getupvalue](https://potassium.gitbook.io/api/environment/debug#debug.getupvalue) * [debug.getupvalues](https://potassium.gitbook.io/api/environment/debug#debug.getupvalues) * [debug.setconstant](https://potassium.gitbook.io/api/environment/debug#debug.setconstant) * [debug.setstack](https://potassium.gitbook.io/api/environment/debug#debug.setstack) * [debug.setupvalue](https://potassium.gitbook.io/api/environment/debug#debug.setupvalue) Copy debug.getinfo( func) Copy > debug.getproto( func, index, active) Copy > debug.getprotos( func) Copy > debug.getstack( func, index) Copy debug.getupvalue( func, index) Copy > debug.getupvalues( func) Copy debug.setconstant( func, index, value) Copy debug.setstack( func, index, value) Copy debug.setupvalue( func, index, value) --- # Instance | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/instance.md) . fireclickdetector[](https://potassium.gitbook.io/api/environment/instance#fireclickdetector) --------------------------------------------------------------------------------------------- Copy fireclickdetector( object, distance) Dispatches a click or hover event to the given ClickDetector. When absent, `distance` defaults to zero. Copy local clickDetector = workspace.Door.Button.ClickDetector fireclickdetector(clickDetector, 10 + math.random()) * * * firetouchinterest[](https://potassium.gitbook.io/api/environment/instance#firetouchinterest) --------------------------------------------------------------------------------------------- Copy firetouchinterest( instance, touchingPart, isTouching) Simulates a touch event between two parts. Copy local rootPart = game.Players.LocalPlayer.Character.HumanoidRootPart firetouchinterest(workspace.TouchPart, rootPart, true) firetouchinterest(workspace.TouchPart, rootPart, false) * * * isnetworkowner[](https://potassium.gitbook.io/api/environment/instance#isnetworkowner) --------------------------------------------------------------------------------------- Copy isnetworkowner( part) Returns `true` if the Part is owned by the player. * * * getcallbackvalue[](https://potassium.gitbook.io/api/environment/instance#getcallbackvalue) ------------------------------------------------------------------------------------------- Returns the function assigned to a callback property of `object`, which cannot be indexed normally. * * * fireproximityprompt[](https://potassium.gitbook.io/api/environment/instance#fireproximityprompt) ------------------------------------------------------------------------------------------------- Fires the trigger of `prompt`. * * * getconnections[](https://potassium.gitbook.io/api/environment/instance#getconnections) --------------------------------------------------------------------------------------- Creates a list of Connection objects for the functions connected to `signal`. Field Type Description `Enabled` boolean Whether the connection can receive events. `ForeignState` boolean Whether the function was connected by a foreign Luau state (i.e. CoreScripts). `LuaConnection` boolean Whether the connection was created in Luau code. `Function` function? The function bound to this connection. Nil when `ForeignState` is true. `Thread` thread? The thread that created the connection. Nil when `ForeignState` is true. Method Description `Fire(...: any): ()` Fires this connection with the provided arguments. `Defer(...: any): ()` [Defers](https://devforum.roblox.com/t/beta-deferred-lua-event-handling/1240569) an event to connection with the provided arguments. `Disconnect(): ()` Disconnects the connection. `Disable(): ()` Prevents the connection from firing. `Enable(): ()` Allows the connection to fire if it was previously disabled. * * * getconnection[](https://potassium.gitbook.io/api/environment/instance#getconnection) ------------------------------------------------------------------------------------- Returns a Connection object for `index` . * * * firesignal[](https://potassium.gitbook.io/api/environment/instance#firesignal) ------------------------------------------------------------------------------- Fires all Lua connections of `signal` . * * * getcustomasset[](https://potassium.gitbook.io/api/environment/instance#getcustomasset) --------------------------------------------------------------------------------------- Returns a `rbxasset://` content id for the asset located at `path`, allowing you to use unmoderated assets. Internally, files are copied to the game's content directory. * * * gethiddenproperty[](https://potassium.gitbook.io/api/environment/instance#gethiddenproperty) --------------------------------------------------------------------------------------------- Returns the value of a hidden property of `object`, which cannot be indexed normally. If the property is hidden, the second return value will be `true`. Otherwise, it will be `false`. * * * setsimulationradius[](https://potassium.gitbook.io/api/environment/instance#setsimulationradius) ------------------------------------------------------------------------------------------------- Sets the player's simulationRadius. If `maxSimulationRadius` is specified, it will set that as well. * * * gethui[](https://potassium.gitbook.io/api/environment/instance#gethui) ----------------------------------------------------------------------- Returns a hidden GUI container. Should be used as an alternative to CoreGui and PlayerGui. GUI objects parented to this container will be protected from common detection methods. * * * getinstances[](https://potassium.gitbook.io/api/environment/instance#getinstances) ----------------------------------------------------------------------------------- Returns a list of every Instance referenced on the client. * * * getnilinstances[](https://potassium.gitbook.io/api/environment/instance#getnilinstances) ----------------------------------------------------------------------------------------- Like `getinstances`, but only includes Instances that are not descendants of a service provider. * * * isscriptable[](https://potassium.gitbook.io/api/environment/instance#isscriptable) ----------------------------------------------------------------------------------- Returns whether the given property is scriptable (does not have the `notscriptable` tag). If `true`, the property is scriptable and can be indexed normally. If `nil`, the property does not exist. * * * sethiddenproperty[](https://potassium.gitbook.io/api/environment/instance#sethiddenproperty) --------------------------------------------------------------------------------------------- Sets the value of a hidden property of `object`, which cannot be set normally. Returns whether the property was hidden. * * * setrbxclipboard[](https://potassium.gitbook.io/api/environment/instance#setrbxclipboard) ----------------------------------------------------------------------------------------- Sets the Studio client's clipboard to the given `rbxm` or `rbxmx` model data. This allows data from the game to be copied into a Studio client. * * * setscriptable[](https://potassium.gitbook.io/api/environment/instance#setscriptable) ------------------------------------------------------------------------------------- Set whether the given property is scriptable. Returns whether the property was scriptable prior to changing it. * * * getrendersteppedlist[](https://potassium.gitbook.io/api/environment/instance#getrendersteppedlist) --------------------------------------------------------------------------------------------------- Returns all callbacks bound with `RunService.BindToRenderStep` . * * * replicatesignal[](https://potassium.gitbook.io/api/environment/instance#replicatesignal) ----------------------------------------------------------------------------------------- Replicates `signal` on the server. If `signal` has one or multiple arguments, they must be provided in the call. * * * [PreviousInput](https://potassium.gitbook.io/api/environment/input) [NextMetatable](https://potassium.gitbook.io/api/environment/metatable) Last updated 1 year ago * [fireclickdetector](https://potassium.gitbook.io/api/environment/instance#fireclickdetector) * [firetouchinterest](https://potassium.gitbook.io/api/environment/instance#firetouchinterest) * [isnetworkowner](https://potassium.gitbook.io/api/environment/instance#isnetworkowner) * [getcallbackvalue](https://potassium.gitbook.io/api/environment/instance#getcallbackvalue) * [fireproximityprompt](https://potassium.gitbook.io/api/environment/instance#fireproximityprompt) * [getconnections](https://potassium.gitbook.io/api/environment/instance#getconnections) * [getconnection](https://potassium.gitbook.io/api/environment/instance#getconnection) * [firesignal](https://potassium.gitbook.io/api/environment/instance#firesignal) * [getcustomasset](https://potassium.gitbook.io/api/environment/instance#getcustomasset) * [gethiddenproperty](https://potassium.gitbook.io/api/environment/instance#gethiddenproperty) * [setsimulationradius](https://potassium.gitbook.io/api/environment/instance#setsimulationradius) * [gethui](https://potassium.gitbook.io/api/environment/instance#gethui) * [getinstances](https://potassium.gitbook.io/api/environment/instance#getinstances) * [getnilinstances](https://potassium.gitbook.io/api/environment/instance#getnilinstances) * [isscriptable](https://potassium.gitbook.io/api/environment/instance#isscriptable) * [sethiddenproperty](https://potassium.gitbook.io/api/environment/instance#sethiddenproperty) * [setrbxclipboard](https://potassium.gitbook.io/api/environment/instance#setrbxclipboard) * [setscriptable](https://potassium.gitbook.io/api/environment/instance#setscriptable) * [getrendersteppedlist](https://potassium.gitbook.io/api/environment/instance#getrendersteppedlist) * [replicatesignal](https://potassium.gitbook.io/api/environment/instance#replicatesignal) Copy getcallbackvalue( object, property) Copy fireproximityprompt( prompt) Copy > getconnections( signal) Copy > getconnection( signal, index) Copy firesignal( signal, ...) Copy getcustomasset( path) Copy gethiddenproperty( object, property) Copy local fire = Instance.new("Fire") print(gethiddenproperty(fire, "size_xml")) --> 5, true print(gethiddenproperty(fire, "Size")) --> 5, false Copy setsimulationradius( simulationRadius, maxSimulationRadius) Copy gethui() Copy > getinstances() Copy > getnilinstances() Copy isscriptable( object, property) Copy sethiddenproperty( object, property, value) Copy local fire = Instance.new("Fire") print(sethiddenproperty(fire, "Size", 5)) --> false (not hidden) print(sethiddenproperty(fire, "size_xml", 15)) --> true (hidden) print(gethiddenproperty(fire, "size_xml")) --> 15, true (hidden) Copy setrbxclipboard( data) Copy local data = readfile("model.rbxm") setrbxclipboard(data) -- Can be pasted into Studio Copy setscriptable( object, property, value) Copy
getrendersteppedlist() Copy replicatesignal( signal, ...) Copy replicatesignal(game.Players.LocalPlayer.Kill) --> Kills you local sword = game.Players.LocalPlayer.Character.ClassicSword replicatesignal(sword.Activated) --> Swings the sword --- # Unknown \# Potassium API ## Potassium API - \[Cache\](https://potassium.gitbook.io/api/environment/cache.md) - \[Closures\](https://potassium.gitbook.io/api/environment/closures.md) - \[Console\](https://potassium.gitbook.io/api/environment/console.md) - \[Crypt\](https://potassium.gitbook.io/api/environment/crypt.md) - \[Debug\](https://potassium.gitbook.io/api/environment/debug.md): (These are all accessible in the global table, e.g.: getconstant(...)) - \[Drawing\](https://potassium.gitbook.io/api/environment/drawing.md) - \[File System\](https://potassium.gitbook.io/api/environment/file-system.md) - \[Input\](https://potassium.gitbook.io/api/environment/input.md) - \[Instance\](https://potassium.gitbook.io/api/environment/instance.md) - \[Metatable\](https://potassium.gitbook.io/api/environment/metatable.md) - \[Miscellaneous\](https://potassium.gitbook.io/api/environment/miscellaneous.md) - \[Scripts\](https://potassium.gitbook.io/api/environment/scripts.md) - \[Web Sockets\](https://potassium.gitbook.io/api/environment/web-sockets.md) - \[Actor\](https://potassium.gitbook.io/api/environment/actor.md) --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/input.md). # Input ## isrbxactive \`\`\`lua isrbxactive() \`\`\` Returns whether the game's window is in focus. Must be true for other input functions to work. \*\*\* ## mouse1click \`\`\`lua mouse1click() \`\`\` Dispatches a left mouse button click. \*\*\* ## mouse1press \`\`\`lua mouse1press() \`\`\` Dispatches a left mouse button press. \*\*\* ## mouse1release \`\`\`lua mouse1release() \`\`\` Dispatches a left mouse button release. \*\*\* ## mouse2click \`\`\`lua mouse2click() \`\`\` Dispatches a right mouse button click. \*\*\* ## mouse2press \`\`\`lua mouse2press() \`\`\` Dispatches a right mouse button press. \*\*\* ## mouse2release \`\`\`lua mouse2release() \`\`\` Dispatches a right mouse button release. \*\*\* ## mousemoveabs \`\`\`lua mousemoveabs( x, y) \`\`\` Moves the mouse cursor to the specified absolute position. \*\*\* ## mousemoverel \`\`\`lua mousemoverel( x, y) \`\`\` Adjusts the mouse cursor by the specified relative amount. \*\*\* ## mousescroll \`\`\`lua mousescroll( pixels) \`\`\` Dispatches a mouse scroll by the specified number of pixels. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/crypt.md). # Crypt ## crypt.base64encode \`\`\`lua crypt.base64encode( data) \`\`\` Encodes a string of bytes into Base64. \*\*\* ## crypt.base64decode \`\`\`lua crypt.base64decode( data) \`\`\` Decodes a Base64 string to a string of bytes. \*\*\* ## crypt.encrypt \`\`\`lua crypt.encrypt( data, key, iv, mode) \`\`\` Encrypts an unencoded string using AES encryption. Returns the base64 encoded and encrypted string, and the IV. If an AES IV is not provided, a random one will be generated for you, and returned as a 2nd base64 encoded string. The cipher modes are 'CBC', 'ECB', 'CTR', 'CFB', 'OFB', and 'GCM'. The default is 'CBC'. \*\*\* ## crypt.decrypt \`\`\`lua crypt.encrypt( data, key, iv, mode) \`\`\` Decrypts the base64 encoded and encrypted content. Returns the raw string. The cipher modes are 'CBC', 'ECB', 'CTR', 'CFB', 'OFB', and 'GCM'. \*\*\* ## crypt.generatebytes \`\`\`lua crypt.generatebytes( size) \`\`\` Generates a random sequence of bytes of the given size. Returns the sequence as a base64 encoded string. \*\*\* ## crypt.generatekey \`\`\`lua crypt.generatekey() \`\`\` Generates a base64 encoded 256-bit key. The result can be used as the second parameter for the \`crypt.encrypt\` and \`crypt.decrypt\` functions. \*\*\* ## crypt.hash \`\`\`lua crypt.hash( data, algo) \`\`\` Returns the result of hashing the data using the given algorithm. Some algorithms include 'sha1', 'sha384', 'sha512', 'md5', 'sha256', 'sha3-224', 'sha3-256', and 'sha3-512'. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/metatable.md). # Metatable ## getrawmetatable \`\`\`lua
getrawmetatable(
object) \`\`\` Returns the metatable of \`object\`, where the \`\_\_metatable\` field would normally lock the metatable. \*\*\* ## hookmetamethod \`\`\`lua hookmetamethod(
object, method, hook) \`\`\` Replaces \`func\` with \`hook\` internally, where \`hook\` will be invoked in place of \`func\` when called. Returns a new function that can be used to access the original definition of \`func\`. \*\*\* ## getnamecallmethod \`\`\`lua getnamecallmethod() \`\`\` Returns the name of the method that invoked the \`\_\_namecall\` metamethod. \*\*\* ## setnamecallmethod \`\`\`lua setnamecallmethod( method) \`\`\` Changes the name of the method that invoked \`\_\_namecall\` metamethod. \*\*\* ## isreadonly \`\`\`lua isreadonly(
object) \`\`\` Returns whether \`object\` is read-only or not. \*\*\* ## setrawmetatable \`\`\`lua setrawmetatable(
object,
metatable) \`\`\` Sets the metatable of \`object\` to \`metatable\`, where the \`\_\_metatable\` field would normally lock the metatable. \*\*\* ## setreadonly \`\`\`lua setreadonly(
object, readonly) \`\`\` Sets whether \`object\` is read-only or not. \*\*\* ## makewriteable \`\`\`lua makewriteable(
object) \`\`\` Unfreezes \`object\` . \*\*\* ## makereadonly \`\`\`lua makereadonly(
object) \`\`\` Freezes \`object\` , where table.freeze would normally check for \\\_\\\_metatable. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/console.md). # Console ## rconsoleclear \`\`\`lua rconsoleclear() \`\`\` Clears the output of the console window. \*\*\* ## rconsolecreate \`\`\`lua rconsolecreate() \`\`\` ~~Opens the console window. Text previously output to the console will not be cleared.~~ ⚠️ This function is disabled. \*\*\* ## rconsoledestroy \`\`\`lua rconsoledestroy() \`\`\` Clears the output of the console window. \*\*\* ## rconsoleinput \`\`\`lua rconsoleinput() \`\`\` ~~Waits for the user to input text into the console window. Returns the result.~~ ⚠️ This function is disabled. \*\*\* ## rconsoleprint \`\`\`lua rconsoleprint( text) \`\`\` Prints \`text\` to the console window. Does not clear existing text or create a new line. \*\*\* ## rconsolewarn \`\`\`lua rconsolewarn( text) \`\`\` Prints \`text\` as a warning to the console window. Does not clear existing text or create a new line. \*\*\* ## rconsoleerror \`\`\`lua rconsoleerror( text) \`\`\` Prints \`text\` as an error to the console window. Does not clear existing text or create a new line. \*\*\* ## rconsolesettitle \`\`\`lua rconsolesettitle( title) \`\`\` ~~Sets the title of the console window to \`title\`.~~ ⚠️ This function is disabled. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/web-sockets.md). # Web Sockets ## WebSocket.connect \`\`\`lua WebSocket.connect( url) \`\`\` Establishes a WebSocket connection to the specified URL. \`\`\`lua local ws = WebSocket.connect("ws://localhost:8080") ws.OnMessage:Connect(function(message) print(message) end) ws.OnClose:Connect(function() print("Closed") end) ws:Send("Hello, World!") \`\`\` \*\*\* ## WebSocketConnection \`\`\`lua ws = WebSocket.connect(url) \`\`\` ### Methods
MethodDescription
Send(<string> message)
Sends a message over the WebSocket connection
Close()
Closes the WebSocket connection
### Events
EventDescription
OnMessage(<string> message)
Fired when a message is received over the WebSocket connection
OnClose()
Fired when the WebSocket connection is closed
\*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/actor.md). # Actor ## create\\\_comm\\\_channel \`\`\`lua create\_comm\_channel() \`\`\` Returns the channel and the associated ID. \*\*\* ## get\\\_comm\\\_channel \`\`\`lua get\_comm\_channel( id) \`\`\` Returns the communication channel if it exists. \*\*\* ## run\\\_on\\\_actor \`\`\`lua run\_on\_actor( actor, script, ...) \`\`\` Runs a script on an actor thread. \`\`\`lua run\_on\_actor(getactors()\[1\], \[\[\ print("Hello, world!")\ \]\]) \`\`\` \*\*\* ## getactors \`\`\`lua > getactors() \`\`\` Returns a table of all actors that exist within the game. \*\*\* ## is\\\_parallel \`\`\`lua is\_parallel() \`\`\` Returns if the thread is running on an actor. \*\*\* ## run\\\_on\\\_thread \`\`\`lua run\_on\_thread( thread, script, ...) \`\`\` Runs a script on a specified thread, actor threads only. \`\`\`lua run\_on\_thread(getactorthreads()\[1\], \[\[\ print("Hello, world!")\ \]\]) \`\`\` \*\*\* ## getactorthreads \`\`\`lua > getactorthreads() \`\`\` Returns all threads that belong to actors in a table. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/file-system.md). # File System ## readfile \`\`\`lua readfile( path) \`\`\` Returns the contents of the file located at \`path\`. \*\*\* ## listfiles \`\`\`lua > listfiles( path) \`\`\` Returns a list of files and folders in the folder located at \`path\`. The returned list contains whole paths. \*\*\* ## writefile \`\`\`lua writefile( path, data) \`\`\` Writes \`data\` to the file located at \`path\` if it is not a folder. \*\*\* ## makefolder \`\`\`lua makefolder( path) \`\`\` Creates a folder at \`path\` if it does not already exist. \*\*\* ## appendfile \`\`\`lua appendfile( path, data) \`\`\` Appends \`data\` to the end of the file located at \`path\`. Creates the file if it does not exist. \*\*\* ## isfile \`\`\`lua isfile( path) \`\`\` Returns whether or not \`path\` points to a file. \*\*\* ## isfolder \`\`\`lua isfolder( path) \`\`\` Returns whether or not \`path\` points to a folder. \*\*\* ## delfile \`\`\`lua delfile( path) \`\`\` Removes the file located at \`path\`. \*\*\* ## delfolder \`\`\`lua delfolder( path) \`\`\` Removes the folder located at \`path\`. \*\*\* ## loadfile \`\`\`lua loadfile( path, chunkname) \`\`\` Generates a chunk from the file located at \`path\`. The environment of the returned function is the global environment. If there are no compilation errors, the chunk is returned by itself; otherwise, it returns \`nil\` plus the error message. \`chunkname\` is used as the chunk name for error messages and debug information. \*\*\* ## dofile \`\`\`lua dofile( path) \`\`\` Attempts to load the file located at \`path\` and execute it on a new thread. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/scripts.md). # Scripts ## getgc \`\`\`lua > getgc( includetables) \`\`\` Returns a list of objects in the Luau garbage collector. If \`includeTables\` is false, tables will not be included in the list. \*\*\* ## getgenv \`\`\`lua > getgenv() \`\`\` Returns the custom global environment of the executor. \*\*\* ## gettenv \`\`\`lua gettenv( thread) \`\`\` Returns the environment of \`thread\`. \*\*\* ## getreg \`\`\`lua > getreg() \`\`\` Returns the lua registry. \*\*\* ## getloadedmodules \`\`\`lua > getloadedmodules() \`\`\` Returns a list of ModuleScripts that have been loaded. \*\*\* ## getrenv \`\`\`lua > getrenv() \`\`\` Returns the global environment of the game client. It can be used to access the global functions that LocalScripts and ModuleScripts use. \*\*\* ## getrunningscripts \`\`\`lua > getrunningscripts() \`\`\` Returns a list of scripts that are currently running. \*\*\* ## getscriptbytecode \`\`\`lua getscriptbytecode( script) \`\`\` Returns the raw Luau bytecode of the given script. \*\*\* ## getscriptclosure \`\`\`lua getscriptclosure( script) \`\`\` Generates a new closure using the bytecode of \`script\`. \*\*\* ## getscripthash \`\`\`lua getscripthash( script) \`\`\` Returns a SHA384 hash of the script's bytecode. \*\*\* ## getscripts \`\`\`lua > getscripts() \`\`\` Returns a list of every script in the game. \*\*\* ## getsenv \`\`\`lua > getsenv( script) \`\`\` Returns the global environment of the given script. It can be used to access variables and functions that are not defined as local. \*\*\* ## getthreadidentity \`\`\`lua getthreadidentity() \`\`\` Returns the identity of the current thread. \*\*\* ## setthreadidentity \`\`\`lua setthreadidentity( identity) \`\`\` Sets the current thread identity. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/closures.md). # Closures ## checkcaller \`\`\`lua checkcaller() \`\`\` Returns whether the function currently running was called by the executor. This is useful for metamethod hooks that behave differently when called by the game. \*\*\* ## clonefunction \`\`\`lua clonefunction( func) \`\`\` Generates a new closure based on the bytecode of function \`func\`. \`\`\`lua local function foo() print("Hello, world!") end local bar = clonefunction(foo) foo() --> Hello, world! bar() --> Hello, world! print(foo == bar) --> false \`\`\` \*\*\* ## getcallingscript \`\`\`lua getcallingscript() \`\`\` Returns the script responsible for the currently running function. \*\*\* ## hookfunction \`\`\`lua hookfunction( func, hook) \`\`\` Replaces \`func\` with \`hook\` internally, where \`hook\` will be invoked in place of \`func\` when called. Returns a new function that can be used to access the original definition of \`func\`. If \`func\` is a Luau function (\`islclosure(func) --> true\`), the upvalue count of \`hook\` must be less than or equal to that of \`func\`. \[Lua visibility rules\](http://www.lua.org/manual/5.1/manual.html#2.6) \`\`\`lua local function foo() print("Hello, world!") end local fooRef = hookfunction(foo, function(...) print("Hooked!") end) foo() --> Hooked! fooRef() --> Hello, world! \`\`\` \*\*\* ## iscclosure \`\`\`lua iscclosure( func) \`\`\` Returns whether or not \`func\` is a closure whose source is written in C. \*\*\* ## islclosure \`\`\`lua islclosure( func) \`\`\` Returns whether or not \`func\` is a closure whose source is written in Luau. \*\*\* ## isexecutorclosure \`\`\`lua isexecutorclosure( func) \`\`\` Returns whether or not \`func\` was created by the executor. \*\*\* ## loadstring \`\`\`lua loadstring( source, chunkname) \`\`\` Generates a chunk from the given source code. The environment of the returned function is the global environment. If there are no compilation errors, the chunk is returned by itself; otherwise, it returns \`nil\` plus the error message. \`chunkname\` is used as the chunk name for error messages and debug information. \*\*\* ## newcclosure \`\`\`lua newcclosure( func) \`\`\` Returns a C closure that wraps \`func\`. The result is functionally identical to \`func\`, but identifies as a C closure. \`\`\`lua local foo = function() return true end local bar = newcclosure(foo) print(bar()) --> true \`\`\` \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/cache.md). # Cache ## cache.invalidate \`\`\`lua cache.invalidate( object) \`\`\` Deletes \`object\` from the Instance cache. Effectively invalidates \`object\` as a reference to the underlying Instance. \*\*\* ## cache.iscached \`\`\`lua cache.iscached( object) \`\`\` Checks whether \`object\` exists in the Instance cache. \*\*\* ## cache.replace \`\`\`lua cache.replace( object, newobject) \`\`\` Replaces \`object\` in the Instance cache with \`newObject\`. \*\*\* ## cloneref \`\`\`lua cloneref( object) \`\`\` Returns a copy of the Instance reference to \`object\`. This is useful for managing an Instance without directly referencing it. \*\*\* ## compareinstances \`\`\`lua compareinstances( a, b) \`\`\` Returns whether objects \`a\` and \`b\` both reference the same Instance. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/drawing.md). # Drawing ## Drawing.new \`\`\`lua Drawing.new( type) \`\`\` Create a new drawing object of the specified type.
Objects ## DrawingObject ### BaseDrawingObject | Property | Type | | ------------ | -------- | | Visible | boolean | | ZIndex | number | | Transparency | number | | Color | Color3 | | Destroy | function | ### Line | Property | Type | | --------- | ------- | | From | Vector2 | | To | Vector2 | | Thickness | number | ### Text | Property | Type | | ------------ | ------- | | Text | string | | TextBounds | Vector2 | | Font | number | | Size | number | | Position | Vector2 | | Center | boolean | | Outline | boolean | | OutlineColor | Color3 | ### Image | Property | Type | | -------- | ------- | | Data | string | | Size | Vector2 | | Position | Vector2 | | Rounding | number | ### Circle | Property | Type | | --------- | ------- | | NumSides | number | | Radius | number | | Position | Vector2 | | Thickness | number | | Filled | boolean | ### Square | Property | Type | | --------- | ------- | | Size | Vector2 | | Position | Vector2 | | Thickness | number | | Filled | boolean | ### Quad | Property | Type | | --------- | ------- | | PointA | Vector2 | | PointB | Vector2 | | PointC | Vector2 | | PointD | Vector2 | | Thickness | number | | Filled | boolean | ### Triangle | Property | Type | | --------- | ------- | | PointA | Vector2 | | PointB | Vector2 | | PointC | Vector2 | | Thickness | number | | Filled | boolean |
\*\*\* ## Drawing.Fonts | Index | Value | | --------- | ----- | | UI | 0 | | System | 1 | | Plex | 2 | | Monospace | 3 | \*\*\* ## cleardrawcache \`\`\`lua cleardrawcache() \`\`\` Destroys every drawing object in the cache. Invalidates references to the drawing objects. \*\*\* ## getrenderproperty \`\`\`lua getrenderproperty( drawing, property) \`\`\` Gets the value of a property of a drawing. Functionally identical to \`drawing\[property\]\`. \*\*\* ## isrenderobj \`\`\`lua isrenderobj( object) \`\`\` Returns whether the given object is a valid Drawing. \*\*\* ## setrenderproperty \`\`\`lua setrenderproperty( drawing, property, value) \`\`\` Sets the value of a property of a drawing. Functionally identical to \`drawing\[property\] = value\`. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/miscellaneous.md). # Miscellaneous ## identifyexecutor \`\`\`lua identifyexecutor() \`\`\` Returns the name and version of Potassium. \*\*\* ## lz4compress \`\`\`lua lz4compress( data) \`\`\` Compresses \`data\` using LZ4 compression. \*\*\* ## lz4decompress \`\`\`lua lz4compress( data, size) \`\`\` Decompresses \`data\` using LZ4 compression, with the decompressed size specified by \`size\`. \*\*\* ## messagebox \`\`\`lua messagebox( text, caption, flags) \`\`\` Creates a message box with the specified text, caption, and flags. Yields until the message box is closed, and returns the user input code. \*\*\* \*\*\* ## queue\\\_on\\\_teleport \`\`\`lua queue\_on\_teleport( code) \`\`\` Queues the specified script to be executed after the player teleports to a different place. \*\*\* ## request \`\`\`lua request( options) \`\`\` Sends an HTTP request using the specified options. Yields until the request is complete, and returns the response. | Field | Type | Description | | ------- | ------- | ------------------------ | | Url | string | The URL for the request. | | Method | string | The HTTP method to use. | | Body | string? | The body of the request. | | Headers | table? | A table of headers. | | Cookies | table? | A table of cookies. | \*\*\* ## getinternalparent \`\`\`lua getinternalparent( instance) \`\`\` Returns the internal parent field of the \`instance\`. \*\*\* ## getfflag \`\`\`lua getfflag( fflag) \`\`\` Returns the value of \`fflag\` \*\*\* ## setfflag \`\`\`lua setfflag( fflag, value) \`\`\` Sets the value of \`fflag\` to \`value\` \*\*\* ## setinternalparent
<nil> setinternalparent(<Instance> instance, <Instance> newparent)
Sets the internal parent field of \`instance\` to \`newparent\` \*\*\* ## setclipboard \`\`\`lua setclipboard( text) \`\`\` Copies \`text\` to the clipboard. \*\*\* ## setfpscap \`\`\`lua setfpscap( fps) \`\`\` Sets the in-game FPS cap to \`fps\`. If \`fps\` is 0, the FPS cap is disabled. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/debug.md). # Debug ## debug.isvalidlevel \`\`\`lua debug.isvalidlevel( level) \`\`\` Returns whether \`level\` is a valid level or not. \*\*\* ## debug.getregistry \`\`\`lua > debug.getregistry() \`\`\` Returns the lua registry. \*\*\* ## debug.getconstant \`\`\`lua debug.getconstant( func, index) \`\`\` Returns the constant at \`index\` in the constant table of the function or level \`func\`. Throws an error if the constant does not exist. \*\*\* ## debug.getconstants \`\`\`lua > debug.getconstants( func) \`\`\` Returns the constant table of the function or level \`func\`. \*\*\* ## debug.getinfo \`\`\`lua debug.getinfo( func) \`\`\` Returns debugger information about a function or stack level. #### DebugInfo | Field | Type | Description | | ------------- | -------- | ---------------------------------------------------------------------------------- | | \`source\` | string | The name of the chunk that created the function. | | \`short\_src\` | string | A "printable" version of \`source\` to be used in error messages. | | \`func\` | function | The function itself. | | \`what\` | string | The string "Lua" if the function is a Luau function, or "C" if it is a C function. | | \`currentline\` | number | The current line where the given function is executing. | | \`name\` | string | The name of the function. | | \`nups\` | number | The number of upvalues in the function. | | \`numparams\` | number | The number of parameters in the function. | | \`is\_vararg\` | number | Whether the function has a variadic argument. | \*\*\* ## debug.getproto \`\`\`lua > debug.getproto( func, index, active) \`\`\` Returns the proto at \`index\` in the function or level \`func\` if \`active\` is false. If \`active\` is true, then every active function of the proto is returned. \*\*\* ## debug.getprotos \`\`\`lua > debug.getprotos( func) \`\`\` Returns a list of protos of the function or level \`func\`. \*\*\* ## debug.getstack \`\`\`lua > debug.getstack( func, index) \`\`\` Returns the value at \`index\` in the stack frame \`level\`. Throws an error if no value could be found. If \`index\` is not specified, then the entire stack frame is returned. \*\*\* ## debug.getupvalue \`\`\`lua debug.getupvalue( func, index) \`\`\` Returns the upvalue at \`index\` in the function or level \`func\`. Throws an error if the upvalue does not exist. An upvalue is a local variable used by an inner function, and is also called an \*external local variable\*. Read more on \[Lua visibility rules\](http://www.lua.org/manual/5.1/manual.html#2.6). \*\*\* ## debug.getupvalues \`\`\`lua > debug.getupvalues( func) \`\`\` Returns a list of upvalues of the function or level \`func\`. \*\*\* ## debug.setconstant \`\`\`lua debug.setconstant( func, index, value) \`\`\` Sets the constant at \`index\` in the function or level \`func\` to \`value\`. \*\*\* ## debug.setstack \`\`\`lua debug.setstack( func, index, value) \`\`\` Sets the register at \`index\` in the stack frame \`level\` to \`value\`. \*\*\* ## debug.setupvalue \`\`\`lua debug.setupvalue( func, index, value) \`\`\` Sets the upvalue at \`index\` in the function or level \`func\` to \`value\`. \*\*\* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://potassium.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://potassium.gitbook.io/api/environment/instance.md). # Instance ## fireclickdetector \`\`\`lua fireclickdetector( object, distance) \`\`\` Dispatches a click or hover event to the given ClickDetector. When absent, \`distance\` defaults to zero. \`\`\`lua local clickDetector = workspace.Door.Button.ClickDetector fireclickdetector(clickDetector, 10 + math.random()) \`\`\` \*\*\* ## firetouchinterest \`\`\`lua firetouchinterest( instance, touchingPart, isTouching) \`\`\` Simulates a touch event between two parts. \`\`\`lua local rootPart = game.Players.LocalPlayer.Character.HumanoidRootPart firetouchinterest(workspace.TouchPart, rootPart, true) firetouchinterest(workspace.TouchPart, rootPart, false) \`\`\` \*\*\* ## isnetworkowner \`\`\`lua isnetworkowner( part) \`\`\` Returns \`true\` if the Part is owned by the player. \*\*\* ## getcallbackvalue \`\`\`lua getcallbackvalue( object, property) \`\`\` Returns the function assigned to a callback property of \`object\`, which cannot be indexed normally. \*\*\* ## fireproximityprompt \`\`\`lua fireproximityprompt( prompt) \`\`\` Fires the trigger of \`prompt\`. \*\*\* ## getconnections \`\`\`lua > getconnections( signal) \`\`\` Creates a list of Connection objects for the functions connected to \`signal\`. | Field | Type | Description | | --------------- | --------- | ------------------------------------------------------------------------------ | | \`Enabled\` | boolean | Whether the connection can receive events. | | \`ForeignState\` | boolean | Whether the function was connected by a foreign Luau state (i.e. CoreScripts). | | \`LuaConnection\` | boolean | Whether the connection was created in Luau code. | | \`Function\` | function? | The function bound to this connection. Nil when \`ForeignState\` is true. | | \`Thread\` | thread? | The thread that created the connection. Nil when \`ForeignState\` is true. | | Method | Description | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | \`Fire(...: any): ()\` | Fires this connection with the provided arguments. | | \`Defer(...: any): ()\` | \[Defers\](https://devforum.roblox.com/t/beta-deferred-lua-event-handling/1240569) an event to connection with the provided arguments. | | \`Disconnect(): ()\` | Disconnects the connection. | | \`Disable(): ()\` | Prevents the connection from firing. | | \`Enable(): ()\` | Allows the connection to fire if it was previously disabled. | \*\*\* ## getconnection \`\`\`lua > getconnection( signal, index) \`\`\` Returns a Connection object for \`index\` . \*\*\* ## firesignal \`\`\`lua firesignal( signal, ...) \`\`\` Fires all Lua connections of \`signal\` . \*\*\* ## getcustomasset \`\`\`lua getcustomasset( path) \`\`\` Returns a \`rbxasset://\` content id for the asset located at \`path\`, allowing you to use unmoderated assets. Internally, files are copied to the game's content directory. \*\*\* ## gethiddenproperty \`\`\`lua gethiddenproperty( object, property) \`\`\` Returns the value of a hidden property of \`object\`, which cannot be indexed normally. If the property is hidden, the second return value will be \`true\`. Otherwise, it will be \`false\`. \`\`\`lua local fire = Instance.new("Fire") print(gethiddenproperty(fire, "size\_xml")) --> 5, true print(gethiddenproperty(fire, "Size")) --> 5, false \`\`\` \*\*\* ## setsimulationradius \`\`\`lua setsimulationradius( simulationRadius, maxSimulationRadius) \`\`\` Sets the player's simulationRadius. If \`maxSimulationRadius\` is specified, it will set that as well. \*\*\* ## gethui \`\`\`lua gethui() \`\`\` Returns a hidden GUI container. Should be used as an alternative to CoreGui and PlayerGui. GUI objects parented to this container will be protected from common detection methods. \*\*\* ## getinstances \`\`\`lua > getinstances() \`\`\` Returns a list of every Instance referenced on the client. \*\*\* ## getnilinstances \`\`\`lua > getnilinstances() \`\`\` Like \`getinstances\`, but only includes Instances that are not descendants of a service provider. \*\*\* ## isscriptable \`\`\`lua isscriptable( object, property) \`\`\` Returns whether the given property is scriptable (does not have the \`notscriptable\` tag). If \`true\`, the property is scriptable and can be indexed normally. If \`nil\`, the property does not exist. \*\*\* ## sethiddenproperty \`\`\`lua sethiddenproperty( object, property, value) \`\`\` Sets the value of a hidden property of \`object\`, which cannot be set normally. Returns whether the property was hidden. \`\`\`lua local fire = Instance.new("Fire") print(sethiddenproperty(fire, "Size", 5)) --> false (not hidden) print(sethiddenproperty(fire, "size\_xml", 15)) --> true (hidden) print(gethiddenproperty(fire, "size\_xml")) --> 15, true (hidden) \`\`\` \*\*\* ## setrbxclipboard \`\`\`lua setrbxclipboard( data) \`\`\` Sets the Studio client's clipboard to the given \`rbxm\` or \`rbxmx\` model data. This allows data from the game to be copied into a Studio client. \`\`\`lua local data = readfile("model.rbxm") setrbxclipboard(data) -- Can be pasted into Studio \`\`\` \*\*\* ## setscriptable \`\`\`lua setscriptable( object, property, value) \`\`\` Set whether the given property is scriptable. Returns whether the property was scriptable prior to changing it. \*\*\* ## getrendersteppedlist \`\`\`lua getrendersteppedlist() \`\`\` Returns all callbacks bound with \`RunService.BindToRenderStep\` . \*\*\* ## replicatesignal \`\`\`lua replicatesignal( signal, ...) \`\`\` Replicates \`signal\` on the server. If \`signal\` has one or multiple arguments, they must be provided in the call. \`\`\`lua replicatesignal(game.Players.LocalPlayer.Kill) --> Kills you local sword = game.Players.LocalPlayer.Character.ClassicSword replicatesignal(sword.Activated) --> Swings the sword \`\`\` \*\*\* --- # Cache | Potassium API For the complete documentation index, see [llms.txt](https://potassium.gitbook.io/api/llms.txt) . This page is also available as [Markdown](https://potassium.gitbook.io/api/environment/cache.md) . cache.invalidate[](https://potassium.gitbook.io/api/environment#cache.invalidate) ---------------------------------------------------------------------------------- Copy cache.invalidate( object) Deletes `object` from the Instance cache. Effectively invalidates `object` as a reference to the underlying Instance. * * * cache.iscached[](https://potassium.gitbook.io/api/environment#cache.iscached) ------------------------------------------------------------------------------ Copy cache.iscached( object) Checks whether `object` exists in the Instance cache. * * * cache.replace[](https://potassium.gitbook.io/api/environment#cache.replace) ---------------------------------------------------------------------------- Copy cache.replace( object, newobject) Replaces `object` in the Instance cache with `newObject`. * * * cloneref[](https://potassium.gitbook.io/api/environment#cloneref) ------------------------------------------------------------------ Copy cloneref( object) Returns a copy of the Instance reference to `object`. This is useful for managing an Instance without directly referencing it. * * * compareinstances[](https://potassium.gitbook.io/api/environment#compareinstances) ---------------------------------------------------------------------------------- Copy compareinstances( a, b) Returns whether objects `a` and `b` both reference the same Instance. * * * [NextClosures](https://potassium.gitbook.io/api/environment/closures) Last updated 1 year ago ---