> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getconnections

> คืน array table ของ RealConnection closures สำหรับ RBXScriptSignal argument แรกต้องเป็น object ที่มี Luau type name เป็น RBXScriptSignal function อ่าน Connect method ของ signal เชื่อม temporary blank callback อ่าน linked list จาก next reference ของ connection ชั่วคราว ตัดการเชื่อมต่อ connection ชั่วคราว แล้ว wrap connection reference ที่ถูกต้องแต่ละรายการ หากไม่พบ connection reference หลัง connection ชั่วคราว จะคืน table ว่าง underlying references ที่เคย wrap แล้วอาจคืน cached closure table เดิม getsignals และ get_signal_cons เป็น aliases ของ function เดียวกัน

<div className="real-function-page">
  ```lua theme={null}
  getconnections(signal: RBXScriptSignal): {RealConnection}
  ```

  ## Aliases

  * `getsignals`
  * `get_signal_cons`

  ## Arguments

  <ParamField path={"signal"} type={"RBXScriptSignal"} required>
    Signal ที่จะตรวจสอบ object ที่ไม่ใช่ RBXScriptSignal จะทำให้เกิด type error และ signal ที่ไม่มี Connect field ที่เรียกได้จะทำให้เกิด "Signal does not have 'Connect' method"
  </ParamField>

  ## Returns

  <ResponseField name={"connections"} type={"{RealConnection}"}>
    Array table ของ connection closure tables แต่ละ closure แสดง fields และ methods ผ่าน methods รวมถึง Enabled, Disabled, LuaConnection, ForeignState, Function, Thread, Disconnect, Disable, Enable, Fire และ Defer เมื่อมีให้ใช้
  </ResponseField>

  ## ตัวอย่าง

  Inspect an RBXScriptSignal and list the wrapped connections Real can expose.

  ```lua theme={null}
  local Players = game:GetService("Players")

  for _, connection in ipairs(getconnections(Players.PlayerAdded)) do
      print(connection.Enabled, connection.LuaConnection)
  end
  ```
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.