Want a special badge and 30 bux? Make some PolyWorld! Content and post it in the Creations forum!
Dark mode is incomplete! Please report any issues to the Discord.

Connection

LocalScripts Scripts Not creatable

A Connection is returned by `Event:Connect` and `Event:Once`.
Use it to stop listening when you no longer need the handler.


Overview

Properties

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()