Skip to content

Connection

Type

Connection is a subscription returned by Signal:Connect, Signal:Once, Entity:On, World.On, or Net.On.

Connected

Field
Connected: boolean

Connected is true while subscribed, and false after Disconnect, after a Once callback runs, when the script stops, or when the owning Entity is destroyed or Tween ends.

Disconnect

Method
Disconnect() -> ()

Disconnect unsubscribes the callback and sets Connected to false.

Example

-- Server script.
local conn: Connection
conn = Component.User.Added:Connect(function(player: Entity)
    print(player.Name)
    conn:Disconnect()
end)
task.wait()
print(conn.Connected)