Documentation written for the latest version of Sentinel which covers the global environment, drawing library, debug library, and bit library.
Last Updated: Monday, June 29, 2020 (2:16 AM EDT)
Sentinel Information
Former Exploit Names
- Veil (by Pkamara)
- Hexus (by Customality)
- Vashta (by Pkamara) (formerly Veil)
- Protosmasher (Slappy826 and Nexure)
Note: Sentinel is a merger of the Hexus and Vashta exploit communities. Old buyers of Hexus and Vashta can no longer claim their free Sentinel whitelist because the migration period ended a while ago.
Developers
- Customality(#0001) - Owner
- Pkamara(#4969) - Website & UI
- Slappy826(#0001) - Execution Method
- KowalskiFX(#2382) - Execution Method & Decompiler (WIP)
- Nexure(#0001) - Website & UI
Website & Purchase Links
There is no official Sentinel website, and there are only links on the Sentinel domain for specific purposes.
Download: https://sentinel.to/download
Password Reset: https://sentinel.to/recover
Note: The password reset email tells you your Sentinel username in case you forget it.
Lifetime License Purchase Link: https://sentinel.to/purchase
48 Hour Subscription Purchase Link: https://bit.ly/SentinelSubscription
Discord Servers
Sentinel: https://discord.gg/sentinel
Sentinel Scripts: https://discord.me/sentinelscripts
Payment Methods
Lifetime License
PayPal (15 USD)- Cryptocurrency (15 USD)
- Bitcoin
- Ethereum
- Litecoin
- Bitcoin Cash
- Credit Card (15 USD)
- Amazon Gift Card (15 USD)
Note: To buy a lifetime license via Amazon Gift Card, join the Sentinel Discord server and DM Customality#0001
48 Hour Subscription
PayPal (2.50 USD)- Cryptocurrency (2.50 USD)
- Bitcoin
- Ethereum
- Litecoin
- Bitcoin Cash
- Credit Card (2.50 USD)
Features
- Various Lua Libraries
- Environment Library
- Input Library
- IO Library
- Hooking Library
- Drawing Library
- Debug Library
- Bit Library
- External UI
- Auto Attach
- FPS Unlocker
- Script Hub
- Sentinel Dex (edited by CriShoux and Google Chrome)
- Owl Hub (by CriShoux and Google Chrome)
- Multiple Tabs
- Script List
- Customer Support
- Available in Discord server
- Automatic Updates
- Fast Injection
- Run Sentinel-encrypted scripts (via
secure_load
) - Dashboard (Account Management)
- Change Password
- Link Discord ID (Get Buyers role in the Discord server)
User Interface
Acknowledgements
Special thanks to these people for contributing to the documentation:
- Greenman(#0001) - Most of the global environment, drawing library, debug library, and bit library
- Google Chrome(#6242) - Providing
setnamecallmethod
- bditt(#0931) - Providing
runscript
andterminatescript
- Customality(#0001) - Providing an example for
debug.getproto
Changelog
Every Sentinel update posted in #announcements
of the Discord server can be viewed here.
Note: Not every update is listed here because there have been multiple Discord servers, which have been deleted, which means I can’t see older changes. Also, pings about Sentinel updating for the latest version of Roblox are not included here.
February 5, 2020
[+] Added get connections[+] Added continue statement to Lua
February 6, 2020
[*] Readfile now errors when the file does not exist[*] Fixed getsenv[*] Fixed getconnections crashing on some signals
February 8, 2020
[*] External UI no longer spam executes once closed
February 10, 2020
[*] Fixed injection bug for certain users[*] Internal UI opens when External UI is closed
February 13, 2020
[+] Added script hub (more scripts will be added to it soon)[+] Auto-Attach is now supported and can be enabled in the settings window[+] FPS can now be unlocked from the UI (also in settings)[*] Fixed Connection:Enable() causing functions to be replaced with garbage values if they're not disabled (getconnections)[*] The script list now shows files in the scripts folder instead of the workspace folder[*] Fixed all upvalue related issues[-] Removed Internal UI
February 17, 2020
[*] Fixed debug.getinfo(f).name[*] Fixed getsenv for ModuleScripts
March 14, 2020
[*] Improved stability on injection and place teleports[*] Disabled trial[-] Removed runscript and terminatescript functions
March 18, 2020
[*] Update for Roblox[+] Added third argument to debug.getproto, set to true to get all instances of the function
March 24, 2020
[+] Added isreadonly[+] Drawing API now clears on teleport
April 2, 2020
[*] Fixed debug.getproto, debug.getprotos, and secure_load [*] Changed syntax for request, now follows Roblox standards. https://developer.roblox.com/en-us/api-reference/function/HttpService/RequestAsync
April 7, 2020
[+] Secure scripts now have their own separate environment [*] Added 5 second timeout to request [*] Fixed issue with request where null bytes would be omitted
[*] Fixed require in secure scripts
April 8, 2020
[*] Many functions have been rewritten and should now work as expected in secure_load [+] Added getsecureenv function. This can only be used in scripts loaded by secure_load [*] Teleporting should hopefully be completely fixed now. Let me know in #support if execution breaks after teleporting
April 11, 2020
We have added a Buyer role that you can get if you own Sentinel. Log into the dashboard at https://dashboard.sentinel.to and link your discord account by going to the "Settings" section.
April 13, 2020
[*] Fix newcclosure crashing on certain errors [*] Patched detection method used on Strucid
Updated again to fix getcallingscript
April 15, 2020
Updated again to fix debug.getinfo
May 10, 2020
It has been a while since we have last properly updated you all on the status of Sentinel development. We have been considering new partners to work with as to alleviate the pressure on our existing developers, as well as speed up the time taken to develop new features. It is with great pleasure that I can announce to you today that we have decided to bring Slappy, Nexure, and KowalskiFX onboard with Sentinel! We hope that you will welcome them warmly to our community. Some of you may be wondering what will be happening with ProtoSmasher in the coming weeks. As of current, ProtoSmasher is NOT discontinued. More information about the state of Protosmasher will be announced in their Discord server. We also have exciting news coming soon, so keep your eyes peeled.
June 8, 2020
[*] Fixed issue with debug.getupvalues
June 10, 2020
[*] Fixed issue with secure scripts, no more crashing from them.
June 11, 2020
[*] Fixed hookfunction
June 23, 2020
[*] Fixed a table for loop bug
June 26, 2020
[*] Fixed wide range of bugs with Sentinel. Crashes should be minimal to none.
DebuggerManager
The DebuggerManager
class allows you to manage Sentinel’s Roblox Lua debugger. Look here to learn how to use it.
appendfile
Documentation
void appendfile(<string> filename, <string> data)
Description
If filename
exists in the workspace folder, data
is appended to the end of the file. If the file doesn’t exist, it writes to a new file. This function is restricted to the workspace folder.
Example
File: test.txt
Hello
Script
appendfile("test.txt", " World!")
File: test.txt
Hello World!
Note: If you replaced appendfile
with writefile
in the script, the file would be overwritten instead of appended to.
checkcaller
Documentation
boolean checkcaller()
Description
Returns true
if the current thread was made by Sentinel and false
if the current thread was not made by Sentinel.
Example
print(checkcaller()) -- true
Additional Notes
If you were to hook a function which comes from a script inside the game and make your hook call checkcaller
, you would get a false
result.
createdirectory
Documentation
void createdirectory(<string> name)
Description
Creates a directory in the workspace folder with the name name
. If the directory already exists, an error occurs.
Example
createdirectory("test")
fireclickdetector
Documentation
void fireclickdetector(<ClickDetector> d)
Description
Simulates a click on ClickDetector d
.
Example
fireclickdetector(game.Workspace.Button.ClickDetector)
Note: The example above doesn’t apply to every situation and is just an example of the values you might call the function with.
getcallingscript
Documentation
userdata getcallingscript()
Description
Returns the script that is calling the current function. If called within Sentinel, it will return nil
.
Example
print(getcallingscript()) --> nil
getconnections
Documentation
table getconnections(<RBXScriptSignal> event)
Description
Returns the functions connected to event
as a table. Each entry in the returned table is a table with Enable
and Disable
methods. You can call those methods to enable/disable connections.
Example
-- disables the event that outputs errors to the dev consolelocal ScriptContext = game:GetService("ScriptContext")for k,v in pairs(getconnections(ScriptContext.Error)) do v:Disable()end
getgc
Documentation
table getgc()
Description
Returns a table containing Lua’s garbage collector.
Example
for k,v in pairs(getgc()) do print(k,v)end
getgenv
Documentation
table getgenv()
Description
Returns Sentinel’s global environment table. This table is not the same as _G
.
Example
Script 1
getgenv().square = function(n) print(n*n)end
Script 2
print(square(2)) --> 4
Additional Notes
As you saw in the above example, getgenv
can be used to add functions to the global environment which can be used across all scripts and tabs.
getinstancecachekey
Unfortunately, I don’t know how to use this.
getloadedmodules
Documentation
table getloadedmodules()
Description
Returns a table containing the loaded ModuleScript
s in the game.
Example
for k,v in pairs(getloadedmodules()) do print(k,v)end
Additional Notes
Keep in mind that the returned table uses numeric indices as keys so you will have to use a conditional statement to search for certain ModuleScript
s.
getmenv
This function is identical to getsenv
. Click here to jump to that page.
getnamecallmethod
Documentation
string getnamecallmethod()
Description
Returns the name of the method being called on an instance as a string. This only works when used within a __namecall
hook.
Example
local mt = getrawmetatable(game)local oldnamecall = mt.__namecallsetreadonly(mt,false)mt.__namecall = newcclosure(function(self,...) if getnamecallmethod() == "FireServer" then print("A RemoteEvent was called with the name "..self.Name) end return oldnamecall(self,...)end)
getnilinstances
Documentation
table getnilinstances()
Description
Returns a table containing all instances in the game parented to nil
.
Example
for k,v in pairs(getnilinstances()) do print(k,v)end
Documentation
table getrawmetatable(<table, userdata> t)
Description
Gets the metatable of table or userdata t
and returns it without invoking __metatable
and sets the readonly value of the metatable to false.
Example
print(getmetatable(game)) --> The metatable is lockedprint(getrawmetatable(game)) --> table: 0xADDR
getreg
Documentation
table getreg()
Description
Returns the Lua registry table.
Example
for k,v in pairs(getreg()) do print(k,v)end
getrenv
Documentation
table getrenv()
Description
Returns Roblox’s global environment table.
Example
for k,v in pairs(getrenv()) do print(k,v)end
getrunningscripts
Documentation
table getrunningscripts()
Description
Returns a table containing all of the scripts that are currently running.
Example
for k,v in pairs(getrunningscripts()) do print(k,v)end
getsenv
Documentation
table getsenv()
Description
Returns the global environment table of LocalScript script
.
Example
Note: This example only works in Prison Life
local env = getsenv(game.Players.LocalPlayer.Character.ClientInputHandler)for k,v in pairs(env) do print(k,v)end
Additional Notes
Keep in mind that every script’s global environment table contains a global called script
which is the current script.
getspecialinfo
Documentation
table getspecialinfo(<UnionOperation> u)
Description
Returns a table containing the special information of a UnionOperation instance u
.
Example
-- to use this example, find a UnionOperation with Dex in a game and replace the pathfor k,v in pairs(getspecialinfo(workspace.Plant.Model.Union)) do print(k,v)end
getthreadcontext
Documentation
int getthreadcontext()
Description
Returns the current thread’s security context level.
Example
print(getthreadcontext()) --> 6
hookfunction
This function is identical to replaceclosure
. Click here to jump to that page.
iscclosure
Documentation
boolean iscclosure(<function> closure)
Description
Returns a boolean that tells you if closure
is a C closure (true
) or a Lua closure (false
)
Example
function square(n) return n*nendprint(iscclosure(square)) --> falseprint(iscclosure(loadstring)) --> true
islclosure
Documentation
boolean islclosure(<function> closure)
Description
Returns a boolean that tells you if closure closure
is a Lua closure ( true
) or a C closure (false
).
Example
function square(n) return n*nendprint(islclosure(square)) --> trueprint(islclosure(loadstring)) --> false
isluau
Documentation
boolean isluau()
Description
Returns a boolean that tells you whether a game has the new Luau VM enabled (true
) or not (false
). Now that all games use Luau, this function will always return true
and just exists for legacy purposes.
Example
print(isluau()) --> true
isrbxactive
Documentation
boolean isrbxactive()
Description
Returns true
if the Roblox window is focused and false
otherwise.
Example
print(isrbxactive()) --> false
Note: If you run this script with no delay, it will always be false
since you are focused on the Sentinel window while clicking Execute.
isreadonly
Documentation
boolean isreadonly(<table> t)
Description
Returns true
if t
is read-only and false
otherwise.
Example
local t = {1, 2, 3} print(isreadonly(t)) --> false local t2 = {'a', 'b', 'c'} setreadonly(t2, true) print(isreadonly(t2)) --> true
issentinelclosure
Documentation
boolean issentinelclosure(<function> closure)
Description
Returns true
if closure
originates from Sentinel.
Example
print(issentinelclosure(writefile)) --> trueprint(issentinelclosure(print)) --> false
Note: The second line returns false
because print
originates from Lua’s global environment.
keypress
Documentation
void keypress(<number> keycode)
Description
Continuously presses the key indicated by keycode
until keyrelease
is called with the same keycode.
Example
wait(1) -- gives you some time to click on the Roblox windowkeypress(0x20) -- press spacebarwait()keyrelease(0x20) -- release spacebar
Additional Notes
To see a list of keycodes, visit this link: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
Make sure to add a delay between the call to keypress
and keyrelease
or else the input will be too fast for your computer to register. Use wait()
for a very short delay.
keyrelease
Documentation
void keyrelease(<number> keycode)
Description
Releases the key indicated by keycode
if it’s being held down (via keypress).
Example
wait(1) -- gives you some time to click on the Roblox windowkeypress(0x20) -- press spacebarwait()keyrelease(0x20) -- release spacebar
Additional Notes
To see a list of keycodes, visit this link: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
Make sure to add a delay between the call to keypress
and keyrelease
or else the input will be too fast for your computer to register. Use wait()
for a very short delay.
loadfile
Documentation
function,<nil,string> loadfile(<string> filename)
Description
Compiles a Lua function from the contents of filename
and returns it. If any errors are produced, nil
is returned plus the error message as a string.
Example
test.txt
print("Hello")
test2.txt
script
Script
loadfile("test.txt")() -- Helloprint(loadfile("test2.txt")) -- nil [string "script"]:1: '=' expected near '<eof>'
loadstring
Documentation
function,<nil,string> loadstring(<string> source [,<string> chunkname])
Description
Compiles a Lua function from string
and returns it. If any errors are produced, nil
is returned plus the error message as a string.
Example
print(loadstring("print('hi')")) --> function: 0xADDRprint(loadstring("lol")) --> nil [string "lol"]:1: `=` expected near `<eof>`loadstring("print('hi'))")() --> hi
messagebox
Documentation
int messagebox(<string> title, <string> caption, <int> options)
Description
Creates a Windows message box with the title set to title
and the caption set to caption
. When the message box is created, Roblox is paused in the background and the script is yielded until a button or X is clicked. The default message box just has an OK button but you can add an icon and change the buttons using the options
argument. The integer returned by the function is based on which button you press on the message box.
Example
messagebox("Sentinel Message!", "Hello there!")
messagebox("Sentinel Message!", "Hello there!", 0x35)
Additional Notes
The options
argument is a hexadecimal number and each digit indicates a specific option. You can view all available options at the official documentation: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox
Tip: When writing out the hexadecimal numbers from the WINAPI documentation, remove the L
at the end so it works in Lua.
mouse1click
Documentation
void mouse1click()
Description
Simulates the left mouse button being clicked one time.
Example
mouse1click()
mouse1press
Documentation
void mouse1press()
Description
Simulates the left mouse button being held down. To stop simulating this, call mouse1release()
.
Example
-- Hold left mouse for 3 secondsmouse1press()wait(3)mouse1release()
mouse1release
Documentation
void mouse1release()
Description
Simulates the left mouse button being released. Commonly used after calling mouse1press()
.
Example
-- Hold left click for 3 secondsmouse1press()wait(3)mouse1release()
mouse2click
Documentation
void mouse2click()
Description
Simulates the right mouse button being clicked one time.
Example
mouse2click()
mouse2press
Documentation
void mouse2press
Description
Simulates the right mouse button being clicked one time.
Example
mouse2click()
mouse2release
Documentation
void mouse2release()
Description
Simulates the right mouse button being released. This is commonly used after calling mouse2press()
.
Example
-- Hold right click for 3 secondsmouse2press()wait(3)mouse2release()
movemouseabs
Documentation
void mousemoveabs(<number> x, <number> y)
Description
Moves the mouse by x
and y
starting at the top left corner of the Roblox window. Keep in mind that a positive y value moves the mouse down.
Example
mousemoveabs(100, 100)
movemouserel
Documentation
void mousemoverel(<number> x, <number> y)
Description
Moves the mouse by x
and y
relative to the mouse’s current position. Keep in mind that a positive y value moves the mouse down.
Example
mousemoverel(100, 100)
newcclosure
Documentation
function newcclosure(<function> lclosure)
Description
Takes an lclosure (Lua function) and returns a new cclosure (C function). This is commonly used when setting the metamethods of a Roblox userdata such as game
.
Example
local oldf = hookfunction(getrawmetatable(game).__namecall,newcclosure(function(self,...) if getnamecallmethod() == "Kick" then return end return oldf(self,...)end))
queue_on_teleport
Documentation
void queue_on_teleport(<string> source)
Description
Adds a string of Lua code source
to a queue which is used when you teleport to another game. When you teleport to another game, every string of Lua code in the queue is executed in order.
Example
queue_on_teleport("print('hi')")queue_on_teleport("print('hi again')")game:GetService('TeleportService'):Teleport(game.PlaceId) -- teleports to the same game-- After Teleport Output:-- hi-- hi again
Additional Notes
This function will not check for errors and if the script has an error, you will see the error message after teleporting in the Roblox console. If you want to put a big script in the queue, it’s best to place that script in the workspace
folder and use readfile
to give queue_on_teleport
the file contents.
readfile
Documentation
string readfile(<string> filename)
Description
Returns the contents of filename
from the workspace folder as a string.
Example
test.txt
Hi
Script
print(readfile("test.txt")) --> Hi
replaceclosure
Documentation
function replaceclosure(<function> target, <function> hook)
Description
Intercepts any calls to C closuretarget
to C closure hook
. target
is returned and can be used within hook
to call the original function.
Example
square = newcclosure(function(n) print(n*n)end)square(2) -- 4replaceclosure(square,newcclosure(function(n) print(n*n*n)end))square(2) -- 8
Additional Notes
Keep in mind that in order to make the hook
argument a C closure, you should use newcclosure(f)
.
request
Note: This function was changed on April 2, 2020 to match Roblox’s HttpService:RequestAsync
.
Documentation
table request(<table> options)
Description
Sends a request configured by the options
table. A table is returned which gives you information about the response of the request. See RequestAsync on the Roblox Wiki to learn more about the options you can provide and the response table.
Example
local r = request({ Url = "https://pastebin.com/raw/MVrUGHk5", Method = "GET" }) print(r.StatusCode) --> 200 print(r.Body) --> Hi
Additional Notes
Keep in mind that the request will have the User-Agent
header set to sentinel
and the Sentinel-Fingerprint
header because it’s used internally for the HWID whitelist.
secure_create
Documentation
None
Description
Used to create encrypted scripts which can be ran with secure_load
. Only certain people have authorization to use this function and anyone else who tries to use it will get a Not authorized!
error message.
Note: DO NOT ASK AUTHORIZED PEOPLE TO ENCRYPT SCRIPTS FOR YOU
secure_load
Documentation
void secure_load(<string> script)
Description
Takes in a script encrypted by secure_create
and runs it.
Example
secure_load("Sy0TjpZ3KylrexYHHldftzp3oZPSCJxdRprPPPpK5H+k3GCs1ONXUyAuiti636nFXkXkgfzKlV/JUDdMoBfYA32xSlC7HQBet9mcFz2N0q9uJokrl9UyONzL2vh0KTtJWnrITMaBJQcleutkEB6SYXyrbapdCj60AtdIypqSK4/M22JRodwdX2EbpTHaf714/QkPftcMn95/nMjJbBZ//meQROk/edNjOFUIQw0g1AYZYCU5v6VPTqAdpsG11I6ECJnmudrCcebnYuEyaKmTRZxwFJWWQv+dvnoJJWfZGCU7xOdeLyV+vBXdyskODWy1AqsrS6yl0z8rMSpO+CbY6+awXW0nAAuzigUuHy1wbJ+Ib2c5nuOq2S6iq69hRBn/J163EB3/j+SBBkFliUr3m86kZcWzyU4myd7at6st0S0wfZON7GtYgwO9ihbVCz94xw3nOfFErabrrOYYsjbRMEOS4ANon/nuY2pCJNGnnraOTJ4U9YXC5yW69cqSPKZ9KNrbk1GhQAzUKFs/VhkbYQYbaeiECF0a19BvcA5a+tmPftdImHn7peTaxQu/RIcFNlcIx5XyNoBwqyaAwFTQT0/Kjbd8oFP9VYQZ/4s8UKPepbAttumDTpHsuyj/ZdpstesbkFz3Tm25o3Oi2nvXAFiFam4NDybn6uTVOye5cmilLOYSJDA5XjA5Ib3q9aqPT4gFRgn4ByRoj7npu9n4yw79/Azjy+g/BH77dO8QGD4oNBQODuGyyEoBHxu2Bxy5Q+vIO/D8c+qZyvm/rUwNbl6HLpTYn9efbBCcxAMQ6q0UfTyN64oI1ocSCSEbyYxh7Tg4SUGQ1cZrhnpfF1fEz9bUB7pji*zpH1IZtCdK8IGWAEPcFffOrfiV9MB/rRdNnuYK9l6dqNwRdC2xnMdYnJ0MnngeYwHfvbBJYj1ItJteM/9XIOexSjOSqbBY1wDuLDnX8pEiBHvjetj+o2nAtecNqq/Lwf39ZLLJ5GG/SwZFXD2/qU/nzoNlWVqhtI91DqJMJafxFVa2PNk/2XdtEPKkW0vMAe/NDUfHKc34YOLzdhXro4W87DSSsE4IrnXpiD0kZG3oJZ384dBb6Zl/LbX7IUphKtUWWbYcW7xL3MaK3ZVy+H/dRXx8mBNn5hhbDETM6jYPzs/tlQ/kUteO4XA==") -- Hello World
sentinelbuy
Documentation
void sentinelbuy()
Description
Opens the Sentinel purchase page (https://elymltd.selly.store/product/a6576d71) in your default browser.
Example
sentinelbuy()
setclipboard
Documentation
void setclipboard()
Description
Copies data
to the clipboard.
Example
-- copy your player's current positionlocal pos = game.Players.LocalPlayer.Character.HumanoidRootPart.Positionsetclipboard("Vector3.new("..tostring(pos)..")") -- example: Vector3.new(0,0,0)
setfflag
Documentation
void setfflag(<string> flag, <string> value)
Description
Sets the value of fast flag flag
to value
.
Example
setfflag("UIGradientEnabled", "true")Instance.new("UIGradient")
Additional Notes
To browse through a list of fast flags, look here: https://fflag.eryn.io/
setnamecallmethod
Documentation
void setnamecallmethod(<string> name)
Description
Sets the current method name to name
.
Example
Provided by Google Chrome#6242
local mt = getrawmetatable(game)local oldnamecall = mt.__namecallsetreadonly(mt,false)mt.__namecall = newcclosure(function(self,...) if getnamecallmethod() == "FireServer" then setnamecallmethod("InvokeServer") print("A RemoteEvent was called with the name "..self.Name) end return oldnamecall(self,...)end)
Note: After running the example, any time :FireServer
is called, :InvokeServer
is called instead.
setreadonly
Documentation
void setreadonly(<table> t, <bool> b)
Description
Sets t
's readonly value to b
.
Example
local mt = getrawmetatable(game)setreadonly(mt, false) -- allows us to modify game's metatable
setthreadcontext
Documentation
void setthreadcontext(<number> level)
Description
Sets the current thread’s context level to level
.
Example
setthreadcontext(4)print(getthreadcontext()) --> 4
setthreadscript
Coming soon
writefile
Documentation
void writefile(<string> filename, <string> data)
Description
Writes data
to a file called filename
in the workspace folder. If the file already exists, the file is overwritten. This function is restricted to the workspace folder.
Example
writefile("test.txt","print('Hi')")loadfile("test.txt")() --> Hi
Drawing.new
Documentation
userdata Drawing.new(<string> classname)
Description
Returns a new drawing object of the class classname
. If a class name is not provided, an error is generated.
The available classes are:
- Line
- Circle
- Square
- Triangle
- Text
Example
local drawing = Drawing.new("Line")
Base Class
Note: This class cannot be created with Drawing.new
and all other drawing classes inherit properties from this class.
Type | Property/Method | Default Value | Description |
---|---|---|---|
boolean | Visible | false | Controls if the drawing is visible or not. |
number | ZIndex | 1 | Determines if the drawing displays behind or in front of other drawings. |
void | Remove() | N/A | Removes the drawing object. |
Line Class
Type | Property/Method | Default Value | Description |
---|---|---|---|
Vector2 | From | Vector2.new(0,0) | A 2D coordinate that indicates the starting point of the line. |
Vector2 | To | Vector2.new(0,0) | A 2D coordinate that indicates the end point of the line. |
Color3 | Color | Color3.new(0,0,0) | The color of the line. The default color is black. |
number | Thickness | 16 | The thickness of the line. |
number | Transparency | 1 | The transparency of the line. The scale is from 0 to 1 with 0 being invisible and 1 being opaque. |
The Vector2
and Color3
datatypes may be unfamiliar because they are not native Lua types. You can learn about them here:
Square Class
Type | Property/Method | Default Value | Description |
---|---|---|---|
Vector2 | Position | Vector2.new(0,0) | A 2D coordinate that indicates where the square will be placed. |
Vector2 | Size | Vector2.new(0,0) | A 2D width and height that indicates the size of the square. You can use a different width and height to make a rectangle. |
Color3 | Color | Color3.new(0,0,0) | The color of the square. The default color is black. |
number | Thickness | 16 | The thickness of the line that forms the square. |
boolean | Filled | false | Indicates whether the square should be filled or an outline. |
number | Transparency | 1 | The transparency of the square. The scale is from 0 to 1 with 0 being invisible and 1 being opaque. |
The Vector2
and Color3
datatypes may be unfamiliar because they are not native Lua types. You can learn about them here:
Circle Class
Type | Property/Method | Default Value | Description |
---|---|---|---|
Vector2 | Position | Vector2.new(0,0) | A 2D coordinate that indicates where the square will be placed. Keep in mind that this point will be the center of the circle. |
number | Radius | 0 | The radius of the circle. |
Color3 | Color | Color3.new(0,0,0) | The color of the circle. The default color is black. |
number | Thickness | 15 | The thickness of the line that forms the circle. |
boolean | Filled | false | Indicates whether the circle should be filled or an outline. |
number | Transparency | 1 | The transparency of the circle. The scale is from 0 to 1 with 0 being invisible and 1 being opaque. |
number | NumSides | 250 | The amount of sides used to create the circle. More sides creates a better circle and less lines creates more visible polygons. |
The Vector2
and Color3
datatypes may be unfamiliar because they are not native Lua types. You can learn about them here:
Triangle Class
Type | Property/Method | Default Value | Description |
---|---|---|---|
Vector2 | PointA | Vector2.new(0,0) | A 2D coordinate that indicates one of the vertices of the triangle. |
Vector2 | PointB | Vector2.new(0,0) | A 2D coordinate that indicates one of the vertices of the triangle. |
Vector2 | PointC | Vector2.new(0,0) | A 2D coordinate that indicates one of the vertices of the triangle. |
Color3 | Color | Color3.new(0,0,0) | The color of the triangle. The default color is black. |
number | Thickness | 15 | The thickness of the line that forms the triangle. |
boolean | Filled | false | Indicates whether the triangle should be filled or an outline. |
number | Transparency | 1 | The transparency of the triangle. The scale is from 0 to 1 with 0 being invisible and 1 being opaque. |
The Vector2
and Color3
datatypes may be unfamiliar because they are not native Lua types. You can learn about them here:
Text Class
Type | Property/Method | Default Value | Description |
---|---|---|---|
string | Text | "" | The text to display. |
Vector2 | Position | Vector2.new(0,0) | A 2D coordinate that indicates where the text will be placed. |
Color3 | Color | Color3.new(0,0,0) | The color of the text. The default color is black. |
boolean | Center | false | Indicates whether the text should be left-aligned or centered. |
boolean | Outline | false | Indicates whether the box containing the text should have an outline or not. |
number | Transparency | 1 | The transparency of the text. The scale is from 0 to 1 with 0 being invisible and 1 being opaque. |
Vector2 | TextBounds | Vector2.new(0,16) | READ-ONLY PROPERTY. The width and height of the text box. |
Examples
Here are some examples of drawings to help you understand how to use the library.
Line Example
local line = Drawing.new("Line")line.Visible = trueline.From = Vector2.new(100, 100)line.To = Vector2.new(200, 200)line.Color = Color3.fromRGB(0, 204, 0)line.Thickness = 4line.Transparency = 1
Square Example
local square = Drawing.new("Square")square.Visible = truesquare.Position = Vector2.new(200,200)square.Size = Vector2.new(20,20)square.Thickness = 1square.Filled = truesquare.Color = Color3.fromRGB(204, 51, 0)
Rectangle Example
Although, the class is called “Square”, by making the width and height different, you can create a rectangle.
local rect = Drawing.new("Square")rect.Visible = truerect.Position = Vector2.new(100,100)rect.Size = Vector2.new(100,50)rect.Thickness = 1rect.Filled = truerect.Color = Color3.fromRGB(204, 51, 0)
Circle Example
local circle = Drawing.new("Circle")circle.Visible = truecircle.Position = Vector2.new(100, 100)circle.Radius = 50circle.Color = Color3.fromRGB(51, 102, 255)circle.Thickness = 1circle.Filled = truecircle.Transparency = 0.5circle.NumSides = 1000
Polygon Example
Although, the class is called “Circle”, you can create a polygon by using a very small number for the NumSides
property.
local poly = Drawing.new("Circle")poly.Visible = truepoly.Position = Vector2.new(100, 100)poly.Radius = 50poly.Color = Color3.fromRGB(255, 0, 0)poly.Thickness = 1poly.Filled = truepoly.Transparency = 0.5poly.Sides = 8
Triangle Example
local tri = Drawing.new("Triangle")tri.Visible = truetri.PointA = Vector2.new(10, 40)tri.PointB = Vector2.new(10, 80)tri.PointC = Vector2.new(110, 80)tri.Color = Color3.fromRGB(102, 0, 204)tri.Thickness = 1tri.Filled = truetri.Transparency = 1
Text Example
local text = Drawing.new("Text")text.Visible = truetext.Text = "Hello World"text.Position = Vector2.new(100,100)text.Size = 12text.Color = Color3.fromRGB(255, 51, 204)text.Center = truetext.Outline = falsetext.Transparency = 1-- TextBounds are 77, 16
getconstant
Documentation
any debug.getconstant(<function, int> f, <int> idx)
Description
Returns the constant at index idx
in function or stack level f
.
Example
function test() print("Hello!")endprint(debug.getconstant(test,3)) --> Hello!
getconstants
Documentation
table debug.getconstants(<function, int> f)
Description
Returns a table containing all of the constants at function or stack level f
.
Example
function test() print("Hello!")endfor k,v in pairs(debug.getconstants(test)) do print(k,v)end-- 1 print-- 2 function: 0xADDR-- 3 Hello!
getinfo
Documentation
table debug.getinfo(<function, int> f)
Description
Returns a table containing the following information about the function:
source
- The name of the script the function was defined inwhat
- Where the function originates from (Lua or C/C++)func
- The passed in functionshort_src
- The name of the script in a format that can be used in error messagesname
- The name of the functionnups
- The number of upvalues in the function
Although more information is given, that information is pointless since it has the same values for every function.
Example
local x = 10function test() print(x)endfor k,v in pairs(debug.getinfo(test)) do print(k,v)end-- source @-- what main-- func function: 0xADDR-- short_src-- name-- nups 1
Additional Notes
source
can be@
which indicates the Lua function was defined in Sentinel,=[C]
which indicates the C function is from Sentinel or Roblox, or a path to a script instance which indicates the Lua function was defined in a in-game script.what
can bemain
which indicates the function is a Lua function orC
which indicates the function is a C functionname
can only be retrieved for functions inside an in-game script
Note: Only use this function to get the names of local functions in an in-game script. Better methods exist for getting the other information provided by this function.
This function is identical to getrawmetatable
. Click here to jump to that page.
getproto
Documentation
function, table debug.getproto(<function> f, <int> index [, <boolean> b])
Description
Gets the proto (local function) at index index
of function f
. If b
is provided and set to true
, a table is returned containing all instances of the local function at index index
.
Example
function test() local function x() print("x") end local function y() print("y") end local function z() print("z") endenddebug.getproto(test,1)() --> x
Provided by Customality#0001
-- Provided by Customality#0001local function f() local f = function() print("hello") endendf()f()f()for k,v in pairs(debug.getproto(f, 1, true)) do v()end-- hello-- hello-- hello
Additional Notes
The function are sorted in the order they are defined in. In the first example, the indices are:
Index | Function Name |
---|---|
1 | x |
2 | y |
3 | z |
getprotos
Documentation
table debug.getprotos(<function> f)
Description
Returns a table containing the protos (local functions) of function f
.
Example
function test() local function x() print("x") end local function y() print("y") end local function z() print("z") endendfor k,v in pairs(debug.getprotos(test)) do print(k,v)end-- 1 function: 0xADDR (x)-- 2 function: 0xADDR (y)-- 3 function: 0xADDR (z)
Additional Notes
The function are sorted in the order they are defined in. In the above example, the indices are:
Index | Function Name |
---|---|
1 | x |
2 | y |
3 | z |
getregistry
This function is identical to getreg
. Click here to jump to that page.
getstack
Documentation
table debug.getstack(<int> lvl)
Description
Returns a table containing everything (locals, upvalues, constants, protos, etc.) at stack level lvl
.
Example
local x = 10local y = 20local z = 30print("HELLO!")for k,v in pairs(debug.getstack(1)) do print(k,v)end-- OUTPUT-- HELLO!-- 1 10-- 2 20-- 3 30-- 4 function: 0xADDR-- 5 function: 0xADDR-- 6 1-- 7 table: 0xADDR-- 8 table: 0xADDR-- 9 HELLO!
local a = 10print(debug.getstack(1)[1]) --> 10
Additional Notes
There is no function for getting the value at an index of a stack level, but you can index what is returned to achieve the same result (shown in the second example).
getupvalue
Documentation
any debug.getupvalue(<function, int> f, <int> idx)
Description
Returns the upvalue at index idx
in function or stack level f
.
Example
local x = 10local y = 30local z = 99function test() print(x, y, z)endprint(debug.getupvalue(test,1)) --> 10
getupvalues
Documentation
table debug.getupvalues(<function, int> f)
Description
Returns a table containing all of the upvalues at function or stack level f
.
Example
local x = 10local y = 30local z = 99function test() print(x, y, z)endfor k,v in pairs(debug.getupvalues(test)) do print(k,v)end-- 1 10-- 2 30-- 3 99
profilebegin
Documentation
void debug.profilebegin(<string> label)
Description
Starts a profiler under the label label
.
Example
Roblox made a video showcasing full usage of this function: https://www.youtube.com/watch?v=KjPWpzJwTPQ
profileend
Documentation
void debug.profileend()
Description
Stops a profile created with debug.profilebegin
.
Example
Roblox made a video showcasing full usage of this function: https://www.youtube.com/watch?v=KjPWpzJwTPQ
setconstant
Documentation
void debug.getconstant(<function, int> f, <int> idx, <any> value)
Description
Sets the constant at index idx
in function or stack level f
to value
.
Example
function test() print("Hello!")enddebug.setconstant(test, 3, "Sentinel is cool!")test() --> Sentinel is cool!
setstack
Documentation
void debug.setstack(<int> lvl, <int> idx, <any> value)
Description
Sets the value at index idx
in stack level lvl
to value
.
Example
local a = "Sentinel is"local b = " bad"debug.setstack(1, 2, " epic!")print(a..b) --> Sentinel is epic!
setupvalue
Documentation
void debug.setupvalue(<function, int> f, <int> idx, <any> value)
Description
Sets the upvalue at index idx
in function or stack level f
to value
.
Example
local x = 10local y = 20local z = 30function test() print(x,y,z)enddebug.setupvalue(test, 2, 99)test() --> 10 99 30
traceback
Documentation
string debug.traceback([<string> message,] [<int> level]])
Description
Returns a string with a traceback of the call stack at level
(stack level 1 if not provided). You can also include a message to append to the start of the traceback with the message
argument.
Example
function a() local function b() print(debug.traceback("TEST",1)) end b()enda()-- TEST-- @:3-- @:5-- @:8
Additional Notes
Because of Luau, the traceback will not contain the names of the functions called.
arshift
Documentation
int bit.arshift(<int> n, <int> shift)
Description
Performs an arithmetic right shift of shift
bits on n
and returns the result.
Example
print(bit.arshift(256, 8)) --> 1print(bit.arshift(-256, 8)) --> -1
band
Documentation
int bit.band(<int> a, <int> b)
Description
Performs the binary AND operation on a
and b
and returns the result.
Example
print(bit.band(2, 4)) --> 0
Binary Breakdown
Place | a | Operation | b | Result |
---|---|---|---|---|
8 | 0 | AND | 0 | 0 |
4 | 0 | AND | 1 | 0 |
2 | 1 | AND | 0 | 0 |
1 | 0 | AND | 0 | 0 |
bnot
Documentation
int bit.bnot(<int> n)
Description
Performs the binary NOT operation on n
and returns the result.
Example
print(bit.bnot(5)) --> -6
Note: When working with this operator, remember that all 64 bits will be flipped.
bor
Documentation
int bit.bor(<int> a, <int> b)
Description
Performs the binary OR operation on a
and b
and returns the result.
Example
print(bit.bor(2, 4)) --> 6
Binary Breakdown
Place | a | Operation | b | Result |
---|---|---|---|---|
8 | 0 | OR | 0 | 0 |
4 | 0 | OR | 1 | 1 |
2 | 1 | OR | 0 | 1 |
1 | 0 | OR | 0 | 0 |
bswap
Documentation
int bit.bswap(<int> n)
Description
Swaps the bytes of n
and returns the result. This can be used to convert the endianness of a number.
Example
print(string.format("0x%x",bit.bswap(0x12345678))) --> 0x78563412
bxor
Documentation
int bit.bxor(<int> a, <int> b)
Description
Performs the binary XOR operation on a
and b
and returns the result.
Example
print(bit.bxor(14, 4)) --> 10
Binary Breakdown
Place | a | Operation | b | Result |
---|---|---|---|---|
8 | 1 | XOR | 0 | 1 |
4 | 1 | XOR | 1 | 0 |
2 | 1 | XOR | 0 | 1 |
1 | 0 | XOR | 0 | 0 |
lshift
Documentation
int bit.lshift(<int> n, <int> shift)
Description
Performs a logical left shift of sh*t
bits on n
and returns the result.
Example
print(bit.lshift(2, 2)) --> 8
Binary Breakdown
Place | Before Shift | After Shift |
---|---|---|
8 | 0 | 1 |
4 | 0 | 0 |
2 | 1 | 0 |
1 | 0 | 0 |
Note: When looking at this table, shifting left is moving up.
rol
Documentation
int bit.rol(<int> n, <int> shift)
Description
Performs a left rotation of shift
bits and returns the result.
Example
print(bit.rol(2147483648, 4)) --> 8
ror
Documentation
int bit.ror(<int> n, <int> shift)
Description
Performs a right rotation of shift
bits on n
and returns the result.
Example
print(bit.ror(1,2)) --> 1073741824
rshift
Documentation
int bit.rshift(<int> n, <int> shift)
Description
Performs a logical right shift of shift
bits on num
and returns the result.
Example
print(bit.rshift(8, 2)) --> 2
Binary Breakdown
Place | Before Shift | After Shift |
---|---|---|
8 | 1 | 0 |
4 | 0 | 0 |
2 | 0 | 1 |
1 | 0 | 0 |
Note: When looking at this table, shifting right is moving down.
tobit
Documentation
int bit.tobit(<int> n)
Description
Converts a 64 bit integer n
to a 32 bit integer for usage with bitwise operations. All functions under the bit
table which do bitwise operations automatically do this to their inputs.
Example
print(bit.tobit(2147483647)) --> 2147483647print(bit.tobit(2147483647 + 1)) --> -2147483648print(bit.tobit(2147483647 + 5)) --> -2147483644print(bit.tobit(-2147483649)) --> 2147483647
tohex
Documentation
string bit.tohex(<int> n)
Description
Converts a decimal number n
into a hexadecimal number and returns the result as a string.
Example
print(bit.tohex(10)) --> 0000000a