sunc docs
  • sUNC Introduction
  • Closures
    • hookfunction
    • hookmetamethod
    • newcclosure
    • iscclosure
    • islclosure
    • isexecutorclosure
    • clonefunction
    • getfunctionhash
  • Cryptography
    • crypt.base64encode
    • crypt.base64decode
  • Debug
    • debug.getconstants
    • debug.getconstant
    • debug.setconstant
    • debug.getupvalues
    • debug.getupvalue
    • debug.setupvalue
  • debug.getstack
  • debug.setstack
  • debug.getprotos
  • debug.getproto
  • Drawing
    • Drawing.new
      • Drawing Objects
    • cleardrawcache
    • getrenderproperty
    • setrenderproperty
    • isrenderobj
  • Environment
    • getgenv
    • getrenv
    • getgc
    • filtergc
  • Filesystem
    • appendfile
    • writefile
    • readfile
    • listfiles
    • isfile
    • delfile
    • loadfile
    • makefolder
    • isfolder
    • delfolder
    • getcustomasset
  • Instances
    • fireproximityprompt
    • fireclickdetector
    • firetouchinterest
    • getinstances
    • getnilinstances
    • cloneref
    • gethui
    • getcallbackvalue
    • compareinstances
  • Metatables
    • getrawmetatable
    • setrawmetatable
    • setreadonly
    • isreadonly
  • Miscellaneous
    • identifyexecutor
    • request
  • Reflection
    • gethiddenproperty
    • sethiddenproperty
    • setscriptable
    • checkcaller
    • setthreadidentity
    • getthreadidentity
  • Scripts
    • getscriptbytecode
    • getscripthash
    • getscriptclosure
    • getsenv
    • getscripts
    • getrunningscripts
    • getloadedmodules
    • getcallingscript
    • loadstring
  • Signals
    • getconnections
      • The Connection object
    • firesignal
    • replicatesignal
  • Websocket
    • WebSocket.connect
Powered by GitBook
On this page
  • Fields
  • Methods
  1. Signals
  2. getconnections

The Connection object

PreviousgetconnectionsNextfiresignal

Last updated 22 days ago

The retrieved connection object will only have the listed methods and fields, since it's a custom object

A new Connectionobject represents an active link to a signal's callback. These are returned by and allow inspection and manipulation over connections / signals.


Fields

If the connection originates from a foreign Lua state or is a C-level connection, Function and Thread will be nil and their ForeignState property will be true . This is due to neither Functionnor Threadexisting in the current Luau VM.

Field
Type
Description

Enabled

boolean

Whether the connection is currently active and will respond to events.

ForeignState

boolean

true if the connection was made from a foreign Lua state (e.g CoreScript)

LuaConnection

boolean

true if the connection was created from Luau, not C or foreign code.

Function

(...any) -> (...any)?

The bound function, or nil in foreign or non-Luau contexts.

Thread

thread?

The thread that created the connection, or nil in foreign or non-Luau contexts


Methods

Method Signature
Description

Connection:Fire(...: any): ()

Fires the connected function with the given arguments.

Connection:Defer(...: any): ()

Connection:Disconnect(): ()

Disconnects the connection from the signal.

Connections:Disable(): ()

Prevents the connection from receiving events.

Connection:Enable(): ()

Re-enables a previously disabled connection.

Defers execution using

getconnections
task.defer