Skip to main content

Twilight

ImageImage
This is the root class for the Twilight ESP Suite. It is what gets returned when the API is called, and contains the functions and interfaces for you to interact with as a developer and user.
This class is not creatable nor replicable.

Summary

Properties

PropertyTypeDescription
Drawings{ [any] : { [any]: Drawing } }Table containing subtables of all of Twilight's Player Drawings.
SettingsTwilightSettingsConfiguration For The ESP.
Highlights{ [any]: Highlight }Table containing all player chams.
ObjectESPs{ Highlights : {[any] : Highlight}, ESPs : { [any] : { [any]: Drawing } } }A Table containing sub-versions of the Highlights and Drawings Tables For Object ESPs.
EnumsTwilightEnumsEasy-Access Pseudocode-like Values To Use For Configurations.
_connections{ [any] : RBXScriptConnection }Internal Library Connections. Used to easily access from within the code.

Methods

MethodArgumentsReturnsDescription
UnloadnilnilDestroys All ESP Instances And Connections.
SetOptionsoptions : TwilightSettingsnilSets The Current .Settings with Defaulting.
BindESPToObjectobject : Part | Model , rootPart? : PartobjectESP : { ... }Creates an Object ESP for the designated object, with a specified rootPart if possible, and returns it.

Properties

Drawings

{ [any] : { [any]: Drawing } | { [any]: { [any]: Drawing | Instance} } }

This property contains all the objectESPs or playerESPs that have not been destroyed. They are subtables of each type of 'esp' there is, such as Boxes, Healthbars, etc. Inside each subtable are Drawings, which are the ESP. The ESP subtable however is different, where instead of containing Drawings, its a property table denoting what drawings are for what object, etc. This Table is meant to be read-only for front-end and back-end users (front-end being your users, back-end being you).

print(table.concat(Twilight.Drawings, ", ")) --> { ESP = { Box = { Drawing, Drawing... }, Tracer = { Drawing, Drawing... }... }, Tracers = { Drawing, Drawing... }, Boxes = { Drawing, Drawing... }, Healthbars = { Drawing, Drawing... }...  }

Settings

TwilightSettings

The current configuration of the ESP for the library to handle. Contains the currentColors, what is enabled, and other shared variables.
It is possible to set the configuration via this property, but it is recommended to use the :SetOptions Method since the mentioned provides default values for those that are not passed. In short, you will have to re-set every variable within the settings if you do it from this property.

Twilight.Settings = {
Enabled = true,
ObjectsEnabled = false,

currentColors = {
generic = {
Box = {
Outline = {
Visible = Color3.new(1, 1, 1),
Invisible = Color3.new(1, 1, 1),
},
Fill = {
Visible = Color3.new(1, 1, 1),
Invisible = Color3.new(1, 1, 1),
},
},
}
},

Box = {
Style = Twilight.Enums.BoxStyle.Normal,
Enabled = true,
Filled = {
Enabled = true,
Transparency = 0.6,
},
Thickness = 1,
},
Tracer = {
Enabled = {
enemy = false,
friendly = false,
generic = true,
},
Origin = Twilight.Enums.TracerOrigin.Viewports.Bottom,
Style = Twilight.Enums.TracerStyle.Line,
Thickness = 1,
}

-- and so forth...
}
print(typeof(Twilight.Settings)) --> TwilightSettings

Highlights

Read Parallel{ [any] : Highlight }

The Highlight Instances That Are Within Player Characters Or Bounded Objects. Separate from the Drawings Table as well as of 1.2, they are not Drawings, but rather roblox instances.

Enums

TwilightEnums

Easily Accesible Pseudocode-like Properties that reference other values for the library to use. These are meant to behave like Roblox's Enums, which are easily accessible and readable as well.
View Twilight Enums for more details.

_connections

READ ONLY{ [any] : RBXScriptConnection }

A table containing active connections to the Roblox well uhh, engine (I suppose? I am not sure how connections actually work).
These are RBXScriptConnections, and what run every well Event they're binded to to update the ESP. Examples of updating include Position and sizing.
Examples of the events are RenderStepped and Changed. Storing them in a global table allows for easy disconnection on destruction.
Not disconnecting will mean the ESP will run until you leave the game even if you disable it, and/or potentially cause memory leaks.

Methods

SetOptions

Sets the current ESP configurations (.Settings Property) to the given TwilightSettings, with defaulting from the previous configuration,
Meaning you will not have to explicitly pass every single parameter.

Parameters
ParameterDescription
options : twilightSettingsThe new configuration for Twilight to use. Check the TwilightSettings page for details. Undefined variables will use the previous configuration's
Returns : nil

BindESPToObject

Creates a new objectESP before binding it to the given object, essentially giving a part ESP that you might see in other scripts.
A root part will automatically be assigned if the given object is a model. Option to pass the root part explicitly will come soon.

Parameters
ParameterDescription
object : Part | ModelThe object to bind the created objectESP to.
rootPart? : PartAn explicit part for the esp to origin from if the object is a model.
Returns: objectESP : { ... }

Functions

Unload

Unloads the ESP and Connections, Destroying Them Permanently.

Parameters
Parameter
self : Twilight