getconnections
Returns all handler connections bound to a given RBXScriptSignal.
function getconnections(signal: RBXScriptSignal): {Connection}Synopsis
How it works
Roblox signals internally maintain a linked listLinked listA data structure where each element (node) contains a pointer to the next element. The Luau GC uses a linked list (global_State->allgc) to track all allocated objects for mark-and-sweep collection. of
ConnectionNode objects from which each connection is returned. getconnections walks this list and wraps each node in a Connection object exposing control methods: Enable(), Disable(), Disconnect(), and Fire().Connection object
Each returned connection has:
.Function— the connected callback function.State—"Active"or"Disabled":Enable()/:Disable()— toggle without disconnecting:Disconnect()— permanently remove the connection:Fire(...)— invoke just this one handler
Anti-cheat bypass
This is commonly used to neutralize anti-cheatAnti-cheatGame-side Luau scripts designed to detect and prevent exploitation. Common checks: verifying closure types (iscclosure), checking metatable integrity, monitoring remote call patterns, and scanning for known executor globals. event handlers. Pattern: enumerate connections on detection signals (e.g.,
Humanoid.Died, Character.ChildRemoved), identify the anti-cheat callback by inspecting its constants or upvaluesUpvalueA variable captured from an enclosing scope. When a function references a local variable from an outer function, that variable becomes an upvalue — stored in an UpVal struct that persists even after the outer function returns., then :Disable() or :Disconnect() it.Usage
Disable all connections on a signal
for _, connection in pairs(getconnections(workspace.ChildAdded)) do
print("Handler:", connection.Function)
connection:Disable()
endParameters
signal RBXScriptSignal The signal to enumerate connections on.
Returns
{Connection} An array of Connection objects, each wrapping a bound handler function.