Signals & connectionsOverview
Connection.Disable
Represents temporary disabling of an event connection.
Details#
Temporarily disables the connection facade without permanently disconnecting it. Use Enable to restore delivery. Function/Thread metadata may be absent for some connections.
Examples#
Example
local event = Instance.new("BindableEvent")
local own = event.Event:Connect(print)
local connection = getconnection(event.Event, 1)
if connection then
connection:Disable()
print(connection.Enabled)
connection:Enable()
end
task.delay(1, function() own:Disconnect(); event:Destroy() end)