Skip to content

Signal

Functions for interacting with Roblox signals (events) and their connections. These allow you to inspect, fire, replicate, and control event connections.

getconnections

Returns a table of connection objects for the given signal.

lua
getconnections(signal: RBXScriptSignal) -> {Connection}
ParameterTypeDescription
signalRBXScriptSignalThe signal to get connections from

Connection Object

MemberTypeDescription
FunctionfunctionThe connected callback function
ThreadthreadThe thread of the connection
Fire(...)methodFires this specific connection
Defer(...)methodDeferred fire of this connection
Disconnect()methodDisconnects this connection
Disable()methodDisables this connection
Enable()methodEnables this connection
EnabledbooleanWhether the connection is enabled

Example

lua
local connections = getconnections(game.Players.LocalPlayer.Chatted)
for _, conn in pairs(connections) do
    print("Connection function:", conn.Function)
    print("Enabled:", conn.Enabled)
end

firesignal

Fires all Lua connections on a signal with the provided arguments. Does not fire CoreScript connections.

Aliases: fireconnection

lua
firesignal(signal: RBXScriptSignal, ...: any) -> void
ParameterTypeDescription
signalRBXScriptSignalThe signal to fire
...anyArguments to pass to the connections

Example

lua
-- Fire the Chatted event as if the player said "hello"
firesignal(game.Players.LocalPlayer.Chatted, "hello")

replicatesignal

Fires a signal on the server. The signal must be replicable (check with canreplicatesignal).

lua
replicatesignal(signal: RBXScriptSignal, ...: any) -> void
ParameterTypeDescription
signalRBXScriptSignalThe signal to replicate
...anyArguments to pass

WARNING

Not all signals can be replicated. Use canreplicatesignal() to check before calling.

Example

lua
local signal = workspace.Part.Touched
if canreplicatesignal(signal) then
    replicatesignal(signal, workspace.Part)
end

canreplicatesignal

Returns true if the signal can be replicated to the server.

Aliases: issignalreplicate, issignalreplicateable

lua
canreplicatesignal(signal: RBXScriptSignal) -> boolean

Example

lua
local signal = workspace.Part.Touched
print(canreplicatesignal(signal)) --> true/false

getreplicatesignalarguments

Returns a table describing the argument types expected by a replicable signal.

lua
getreplicatesignalarguments(signal: RBXScriptSignal) -> table

Example

lua
local args = getreplicatesignalarguments(workspace.Part.Touched)
for i, argType in pairs(args) do
    print(i, argType)
end

enableconnection

Enables a previously disabled connection.

Aliases: enablesignal

lua
enableconnection(connection: Connection) -> void

Example

lua
local connections = getconnections(game.Players.LocalPlayer.Chatted)
for _, conn in pairs(connections) do
    enableconnection(conn)
end

disableconnection

Disables a connection without disconnecting it. The connection can be re-enabled later.

Aliases: disablesignal

lua
disableconnection(connection: Connection) -> void

Example

lua
-- Disable all connections on an event temporarily
local connections = getconnections(game.Players.LocalPlayer.Chatted)
for _, conn in pairs(connections) do
    disableconnection(conn)
end

task.wait(5)

-- Re-enable them
for _, conn in pairs(connections) do
    enableconnection(conn)
end