Connection: Disable Synchronous
Pause an inspected listener while keeping its connection available. Use Enable later to let it receive events again.
Luau
Connection:Disable() -> ()Parameters
Call this method with a Connection receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
This function takes no arguments.
Returns
()No values.
Usage notes
Unlike Disconnect, disabling does not remove the connection. Enabled reflects whether it can currently receive the signal.
Example
Luau
local event = Instance.new("BindableEvent")
event.Event:Connect(function() print("Enabled listener") end)
local connection = getconnection(event.Event, 1)
if connection then
connection:Disable()
print(connection.Enabled) -- false
end
event:Destroy()