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)
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.
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
Sentinel: https://discord.gg/sentinel
Sentinel Scripts: https://discord.me/sentinelscripts
Lifetime License
Note: To buy a lifetime license via Amazon Gift Card, join the Sentinel Discord server and DM Customality#0001
48 Hour Subscription
secure_load)
Special thanks to these people for contributing to the documentation:
setnamecallmethodrunscript and terminatescriptdebug.getprotoEvery 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.
[+] Added get connections
[+] Added continue statement to Lua
[*] Readfile now errors when the file does not exist
[*] Fixed getsenv
[*] Fixed getconnections crashing on some signals
[*] External UI no longer spam executes once closed
[*] Fixed injection bug for certain users
[*] Internal UI opens when External UI is closed
[+] 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
[*] Fixed debug.getinfo(f).name
[*] Fixed getsenv for ModuleScripts
[*] Improved stability on injection and place teleports
[*] Disabled trial
[-] Removed runscript and terminatescript functions
[*] Update for Roblox
[+] Added third argument to debug.getproto, set to true to get all instances of the function
[+] Added isreadonly
[+] Drawing API now clears on teleport
[*] 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
[+] 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
[*] 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
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.
[*] Fix newcclosure crashing on certain errors
[*] Patched detection method used on Strucid
Updated again to fix getcallingscript
Updated again to fix debug.getinfo
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.
[*] Fixed issue with debug.getupvalues
[*] Fixed issue with secure scripts, no more crashing from them.
[*] Fixed hookfunction
[*] Fixed a table for loop bug
[*] Fixed wide range of bugs with Sentinel. Crashes should be minimal to none.
The DebuggerManager class allows you to manage Sentinel’s Roblox Lua debugger. Look here to learn how to use it.
void appendfile(<string> filename, <string> data)
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.
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.
boolean checkcaller()
Returns true if the current thread was made by Sentinel and false if the current thread was not made by Sentinel.
print(checkcaller()) -- true
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.
void createdirectory(<string> name)
Creates a directory in the workspace folder with the name name. If the directory already exists, an error occurs.
createdirectory("test")
void fireclickdetector(<ClickDetector> d)
Simulates a click on ClickDetector d.
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.
userdata getcallingscript()
Returns the script that is calling the current function. If called within Sentinel, it will return nil.
print(getcallingscript()) --> nil
table getconnections(<RBXScriptSignal> event)
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.
-- disables the event that outputs errors to the dev console
local ScriptContext = game:GetService("ScriptContext")
for k,v in pairs(getconnections(ScriptContext.Error)) do
v:Disable()
end
table getgc()
Returns a table containing Lua’s garbage collector.
for k,v in pairs(getgc()) do
print(k,v)
end
table getgenv()
Returns Sentinel’s global environment table. This table is not the same as _G.
Script 1
getgenv().square = function(n)
print(n*n)
end
Script 2
print(square(2)) --> 4
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.
Unfortunately, I don’t know how to use this.
table getloadedmodules()
Returns a table containing the loaded ModuleScripts in the game.
for k,v in pairs(getloadedmodules()) do
print(k,v)
end
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 ModuleScripts.
This function is identical to getsenv. Click here to jump to that page.
string getnamecallmethod()
Returns the name of the method being called on an instance as a string. This only works when used within a __namecall hook.
local mt = getrawmetatable(game)
local oldnamecall = mt.__namecall
setreadonly(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)
table getnilinstances()
Returns a table containing all instances in the game parented to nil.
for k,v in pairs(getnilinstances()) do
print(k,v)
end
table getrawmetatable(<table, userdata> t)
Gets the metatable of table or userdata t and returns it without invoking __metatable and sets the readonly value of the metatable to false.
print(getmetatable(game)) --> The metatable is locked
print(getrawmetatable(game)) --> table: 0xADDR
table getreg()
Returns the Lua registry table.
for k,v in pairs(getreg()) do
print(k,v)
end
table getrenv()
Returns Roblox’s global environment table.
for k,v in pairs(getrenv()) do
print(k,v)
end
table getrunningscripts()
Returns a table containing all of the scripts that are currently running.
for k,v in pairs(getrunningscripts()) do
print(k,v)
end
table getsenv()
Returns the global environment table of LocalScript script.
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
Keep in mind that every script’s global environment table contains a global called script which is the current script.
table getspecialinfo(<UnionOperation> u)
Returns a table containing the special information of a UnionOperation instance u.
-- to use this example, find a UnionOperation with Dex in a game and replace the path
for k,v in pairs(getspecialinfo(workspace.Plant.Model.Union)) do
print(k,v)
end
int getthreadcontext()
Returns the current thread’s security context level.
print(getthreadcontext()) --> 6
This function is identical to replaceclosure. Click here to jump to that page.
boolean iscclosure(<function> closure)
Returns a boolean that tells you if closure is a C closure (true) or a Lua closure (false)
function square(n)
return n*n
end
print(iscclosure(square)) --> false
print(iscclosure(loadstring)) --> true
boolean islclosure(<function> closure)
Returns a boolean that tells you if closure closure is a Lua closure ( true) or a C closure (false).
function square(n)
return n*n
end
print(islclosure(square)) --> true
print(islclosure(loadstring)) --> false
boolean isluau()
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.
print(isluau()) --> true
boolean isrbxactive()
Returns true if the Roblox window is focused and false otherwise.
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.
boolean isreadonly(<table> t)
Returns true if t is read-only and false otherwise.
local t = {1, 2, 3}
print(isreadonly(t)) --> false
local t2 = {'a', 'b', 'c'}
setreadonly(t2, true)
print(isreadonly(t2)) --> true
boolean issentinelclosure(<function> closure)
Returns true if closure originates from Sentinel.
print(issentinelclosure(writefile)) --> true
print(issentinelclosure(print)) --> false
Note: The second line returns false because print originates from Lua’s global environment.
void keypress(<number> keycode)
Continuously presses the key indicated by keycode until keyrelease is called with the same keycode.
wait(1) -- gives you some time to click on the Roblox window
keypress(0x20) -- press spacebar
wait()
keyrelease(0x20) -- release spacebar
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.
void keyrelease(<number> keycode)
Releases the key indicated by keycode if it’s being held down (via keypress).
wait(1) -- gives you some time to click on the Roblox window
keypress(0x20) -- press spacebar
wait()
keyrelease(0x20) -- release spacebar
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.
function,<nil,string> loadfile(<string> filename)
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.
test.txt
print("Hello")
test2.txt
script
Script
loadfile("test.txt")() -- Hello
print(loadfile("test2.txt")) -- nil [string "script"]:1: '=' expected near '<eof>'
function,<nil,string> loadstring(<string> source [,<string> chunkname])
Compiles a Lua function from string and returns it. If any errors are produced, nil is returned plus the error message as a string.
print(loadstring("print('hi')")) --> function: 0xADDR
print(loadstring("lol")) --> nil [string "lol"]:1: `=` expected near `<eof>`
loadstring("print('hi'))")() --> hi
int messagebox(<string> title, <string> caption, <int> options)
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.
messagebox("Sentinel Message!", "Hello there!")

messagebox("Sentinel Message!", "Hello there!", 0x35)

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.
void mouse1click()
Simulates the left mouse button being clicked one time.
mouse1click()
void mouse1press()
Simulates the left mouse button being held down. To stop simulating this, call mouse1release().
-- Hold left mouse for 3 seconds
mouse1press()
wait(3)
mouse1release()
void mouse1release()
Simulates the left mouse button being released. Commonly used after calling mouse1press().
-- Hold left click for 3 seconds
mouse1press()
wait(3)
mouse1release()
void mouse2click()
Simulates the right mouse button being clicked one time.
mouse2click()
void mouse2press
Simulates the right mouse button being clicked one time.
mouse2click()
void mouse2release()
Simulates the right mouse button being released. This is commonly used after calling mouse2press().
-- Hold right click for 3 seconds
mouse2press()
wait(3)
mouse2release()
void mousemoveabs(<number> x, <number> y)
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.
mousemoveabs(100, 100)
void mousemoverel(<number> x, <number> y)
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.
mousemoverel(100, 100)
function newcclosure(<function> lclosure)
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.
local oldf = hookfunction(getrawmetatable(game).__namecall,newcclosure(function(self,...)
if getnamecallmethod() == "Kick" then
return
end
return oldf(self,...)
end))
void queue_on_teleport(<string> source)
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.
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
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.
string readfile(<string> filename)
Returns the contents of filename from the workspace folder as a string.
test.txt
Hi
Script
print(readfile("test.txt")) --> Hi
function replaceclosure(<function> target, <function> hook)
Intercepts any calls to C closuretarget to C closure hook. target is returned and can be used within hook to call the original function.
square = newcclosure(function(n)
print(n*n)
end)
square(2) -- 4
replaceclosure(square,newcclosure(function(n)
print(n*n*n)
end))
square(2) -- 8
Keep in mind that in order to make the hook argument a C closure, you should use newcclosure(f).
Note: This function was changed on April 2, 2020 to match Roblox’s HttpService:RequestAsync.
table request(<table> options)
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.
local r = request({
Url = "https://pastebin.com/raw/MVrUGHk5",
Method = "GET"
})
print(r.StatusCode) --> 200
print(r.Body) --> Hi
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.
None
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
void secure_load(<string> script)
Takes in a script encrypted by secure_create and runs it.
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/rUwNbl6HLpTYn9efbBCcxAMQ6q0UfTyN64oI1ocSCSEbyYxh7Tg4SUGQ1cZrhnpfF1fEz9bUB7pjIZpH1IZtCdK8IGWAEPcFffOrfiV9MB/rRdNnuYK9l6dqNwRdC2xnMdYnJ0MnngeYwHfvbBJYj1ItJteM/9XIOexSjOSqbBY1wDuLDnX8pEiBHvjetj+o2nAtecNqq/Lwf39ZLLJ5GG/SwZFXD2/qU/nzoNlWVqhtI91DqJMJafxFVa2PNk/2XdtEPKkW0vMAe/NDUfHKc34YOLzdhXro4W87DSSsE4IrnXpiD0kZG3oJZ384dBb6Zl/LbX7IUphKtUWWbYcW7xL3MaK3ZVy+H/dRXx8mBNn5hhbDETM6jYPzs/tlQ/kUteO4XA==") -- Hello World
void sentinelbuy()
Opens the Sentinel purchase page (https://elymltd.selly.store/product/a6576d71) in your default browser.
sentinelbuy()
void setclipboard()
Copies data to the clipboard.
-- copy your player's current position
local pos = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
setclipboard("Vector3.new("..tostring(pos)..")") -- example: Vector3.new(0,0,0)
void setfflag(<string> flag, <string> value)
Sets the value of fast flag flag to value.
setfflag("UIGradientEnabled", "true")
Instance.new("UIGradient")
To browse through a list of fast flags, look here: https://fflag.eryn.io/
void setnamecallmethod(<string> name)
Sets the current method name to name.
Provided by Google Chrome#6242
local mt = getrawmetatable(game)
local oldnamecall = mt.__namecall
setreadonly(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.
void setreadonly(<table> t, <bool> b)
Sets t's readonly value to b.
local mt = getrawmetatable(game)
setreadonly(mt, false) -- allows us to modify game's metatable
void setthreadcontext(<number> level)
Sets the current thread’s context level to level.
setthreadcontext(4)
print(getthreadcontext()) --> 4
Coming soon
void writefile(<string> filename, <string> data)
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.
writefile("test.txt","print('Hi')")
loadfile("test.txt")() --> Hi
userdata Drawing.new(<string> classname)
Returns a new drawing object of the class classname. If a class name is not provided, an error is generated.
The available classes are:
local drawing = Drawing.new("Line")
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. |
| 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:
| 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:
| 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:
| 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:
| 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. |
Here are some examples of drawings to help you understand how to use the library.
local line = Drawing.new("Line")
line.Visible = true
line.From = Vector2.new(100, 100)
line.To = Vector2.new(200, 200)
line.Color = Color3.fromRGB(0, 204, 0)
line.Thickness = 4
line.Transparency = 1
local square = Drawing.new("Square")
square.Visible = true
square.Position = Vector2.new(200,200)
square.Size = Vector2.new(20,20)
square.Thickness = 1
square.Filled = true
square.Color = Color3.fromRGB(204, 51, 0)
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 = true
rect.Position = Vector2.new(100,100)
rect.Size = Vector2.new(100,50)
rect.Thickness = 1
rect.Filled = true
rect.Color = Color3.fromRGB(204, 51, 0)
local circle = Drawing.new("Circle")
circle.Visible = true
circle.Position = Vector2.new(100, 100)
circle.Radius = 50
circle.Color = Color3.fromRGB(51, 102, 255)
circle.Thickness = 1
circle.Filled = true
circle.Transparency = 0.5
circle.NumSides = 1000
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 = true
poly.Position = Vector2.new(100, 100)
poly.Radius = 50
poly.Color = Color3.fromRGB(255, 0, 0)
poly.Thickness = 1
poly.Filled = true
poly.Transparency = 0.5
poly.Sides = 8
local tri = Drawing.new("Triangle")
tri.Visible = true
tri.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 = 1
tri.Filled = true
tri.Transparency = 1
local text = Drawing.new("Text")
text.Visible = true
text.Text = "Hello World"
text.Position = Vector2.new(100,100)
text.Size = 12
text.Color = Color3.fromRGB(255, 51, 204)
text.Center = true
text.Outline = false
text.Transparency = 1
-- TextBounds are 77, 16
any debug.getconstant(<function, int> f, <int> idx)
Returns the constant at index idx in function or stack level f.
function test()
print("Hello!")
end
print(debug.getconstant(test,3)) --> Hello!
table debug.getconstants(<function, int> f)
Returns a table containing all of the constants at function or stack level f.
function test()
print("Hello!")
end
for k,v in pairs(debug.getconstants(test)) do
print(k,v)
end
-- 1 print
-- 2 function: 0xADDR
-- 3 Hello!
table debug.getinfo(<function, int> f)
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 functionlocal x = 10
function test()
print(x)
end
for k,v in pairs(debug.getinfo(test)) do
print(k,v)
end
-- source @
-- what main
-- func function: 0xADDR
-- short_src
-- name
-- nups 1
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 be main which indicates the function is a Lua function or C which indicates the function is a C functionname can only be retrieved for functions inside an in-game scriptNote: 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.
function, table debug.getproto(<function> f, <int> index [, <boolean> b])
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.
function test()
local function x()
print("x")
end
local function y()
print("y")
end
local function z()
print("z")
end
end
debug.getproto(test,1)() --> x
Provided by Customality#0001
-- Provided by Customality#0001
local function f()
local f = function() print("hello") end
end
f()
f()
f()
for k,v in pairs(debug.getproto(f, 1, true)) do
v()
end
-- hello
-- hello
-- hello
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 |
table debug.getprotos(<function> f)
Returns a table containing the protos (local functions) of function f.
function test()
local function x()
print("x")
end
local function y()
print("y")
end
local function z()
print("z")
end
end
for k,v in pairs(debug.getprotos(test)) do
print(k,v)
end
-- 1 function: 0xADDR (x)
-- 2 function: 0xADDR (y)
-- 3 function: 0xADDR (z)
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 |
This function is identical to getreg. Click here to jump to that page.
table debug.getstack(<int> lvl)
Returns a table containing everything (locals, upvalues, constants, protos, etc.) at stack level lvl.
local x = 10
local y = 20
local z = 30
print("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 = 10
print(debug.getstack(1)[1]) --> 10
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).
any debug.getupvalue(<function, int> f, <int> idx)
Returns the upvalue at index idx in function or stack level f.
local x = 10
local y = 30
local z = 99
function test()
print(x, y, z)
end
print(debug.getupvalue(test,1)) --> 10
table debug.getupvalues(<function, int> f)
Returns a table containing all of the upvalues at function or stack level f.
local x = 10
local y = 30
local z = 99
function test()
print(x, y, z)
end
for k,v in pairs(debug.getupvalues(test)) do
print(k,v)
end
-- 1 10
-- 2 30
-- 3 99
void debug.profilebegin(<string> label)
Starts a profiler under the label label.
Roblox made a video showcasing full usage of this function: https://www.youtube.com/watch?v=KjPWpzJwTPQ
void debug.profileend()
Stops a profile created with debug.profilebegin.
Roblox made a video showcasing full usage of this function: https://www.youtube.com/watch?v=KjPWpzJwTPQ
void debug.getconstant(<function, int> f, <int> idx, <any> value)
Sets the constant at index idx in function or stack level f to value.
function test()
print("Hello!")
end
debug.setconstant(test, 3, "Sentinel is cool!")
test() --> Sentinel is cool!
void debug.setstack(<int> lvl, <int> idx, <any> value)
Sets the value at index idx in stack level lvl to value.
local a = "Sentinel is"
local b = " bad"
debug.setstack(1, 2, " epic!")
print(a..b) --> Sentinel is epic!
void debug.setupvalue(<function, int> f, <int> idx, <any> value)
Sets the upvalue at index idx in function or stack level f to value.
local x = 10
local y = 20
local z = 30
function test()
print(x,y,z)
end
debug.setupvalue(test, 2, 99)
test() --> 10 99 30
string debug.traceback([<string> message,] [<int> level]])
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.
function a()
local function b()
print(debug.traceback("TEST",1))
end
b()
end
a()
-- TEST
-- @:3
-- @:5
-- @:8
Because of Luau, the traceback will not contain the names of the functions called.
int bit.arshift(<int> n, <int> shift)
Performs an arithmetic right shift of shift bits on n and returns the result.
print(bit.arshift(256, 8)) --> 1
print(bit.arshift(-256, 8)) --> -1
int bit.band(<int> a, <int> b)
Performs the binary AND operation on a and b and returns the result.
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 |
int bit.bnot(<int> n)
Performs the binary NOT operation on n and returns the result.
print(bit.bnot(5)) --> -6
Note: When working with this operator, remember that all 64 bits will be flipped.
int bit.bor(<int> a, <int> b)
Performs the binary OR operation on a and b and returns the result.
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 |
int bit.bswap(<int> n)
Swaps the bytes of n and returns the result. This can be used to convert the endianness of a number.
print(string.format("0x%x",bit.bswap(0x12345678))) --> 0x78563412
int bit.bxor(<int> a, <int> b)
Performs the binary XOR operation on a and b and returns the result.
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 |
int bit.lshift(<int> n, <int> shift)
Performs a logical left shift of shit bits on n and returns the result.
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.
int bit.rol(<int> n, <int> shift)
Performs a left rotation of shift bits and returns the result.
print(bit.rol(2147483648, 4)) --> 8
int bit.ror(<int> n, <int> shift)
Performs a right rotation of shift bits on n and returns the result.
print(bit.ror(1,2)) --> 1073741824
int bit.rshift(<int> n, <int> shift)
Performs a logical right shift of shift bits on num and returns the result.
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.
int bit.tobit(<int> n)
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.
print(bit.tobit(2147483647)) --> 2147483647
print(bit.tobit(2147483647 + 1)) --> -2147483648
print(bit.tobit(2147483647 + 5)) --> -2147483644
print(bit.tobit(-2147483649)) --> 2147483647
string bit.tohex(<int> n)
Converts a decimal number n into a hexadecimal number and returns the result as a string.
print(bit.tohex(10)) --> 0000000a