A Connection is returned by `Event:Connect` and `Event:Once`.
Use it to stop listening when you no longer need the handler.
Overview
Properties
- .Connected readonly : bool
Methods
API
Properties
Connected
Connected readonly : bool
true while the listener is still active.
Becomes false after Disconnect, after Once has fired, or if the Event was cleaned up.
Methods
Disconnect
Disconnect() : void
Stops the listener.
Calling Disconnect again does nothing.
local connection = Players.PlayerAdded:Connect(function(player)
print(player.Name, "joined")
end)
wait(30)
connection:Disconnect()
