> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/datatype/scriptconnection.md).

# ScriptConnection

## Overview

ScriptConnection is a connection object that connects a function written in Lua script to an event.

This object is created when Connect is called and plays an important role in event management by providing a way to stop event handling using the Disconnect function.

## Constructors

## Properties

### Connected

`boolean`

A property representing event connection status.

Returns false when the Disconnect method is called.

#### Code Samples

```lua
local Players = game:GetService("Players")
local Connection = nil

local function EnterPlayer(player)
    print("EnterPlayer : ", player.Name)
end
Connection = Players.PlayerAdded:Connect(EnterPlayer)

if Connection.Connected then
    print("The connection is active.")
else
    print("The connection has been disconnected.")
end
```

## Methods

### Disconnect

Disconnects event and no longer receives the signal.

#### Parameters

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
Connection:Disconnect()
```

## Events

## See also
