# ScriptConnection

## Overview

ScriptConnection은 이벤트에 루아 스크립트로 작성한 함수를 이어주는 연결 객체입니다.

이 객체는 Connect 호출 시 생성되며, 필요할 때 Disconnect 기능을 통해 이벤트 수신을 중단할 수 있도록 해주어 이벤트 관리에 중요한 역할을 합니다.

## Constructors

## Properties

### Connected

`boolean`

이벤트의 연결 상태를 나타내는 속성입니다.

Disconnect 메서드가 호출되면 false값이 반환됩니다.

#### 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

이벤트의 연결을 해제하여, 더 이상 해당 신호를 수신하지 않도록 만듭니다.

#### Parameters

#### Return

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

#### Code Samples

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

## Events

## See also

{% content-ref url="/pages/ZBw9jjPplLCBqveb9rch" %}
[이벤트](/korean/manual/script-manual/events-and-communication/event.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/korean/development/api-reference/datatype/scriptconnection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
