Connection: Disconnect Synchronous
Remove an inspected listener from its Roblox signal. Use it when you have confirmed a connection is no longer needed.
Luau
Connection:Disconnect() -> ()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
Disconnection is permanent for that listener. The Connection object remains inspectable, but Enabled becomes false.
Example
Luau
local event = Instance.new("BindableEvent")
event.Event:Connect(function() print("Old listener") end)
local connection = getconnection(event.Event, 1)
if connection then connection:Disconnect() end
event:Fire()
event:Destroy()