Connections
This is a class that makes handling connections (RBXConnections) easier!
Functions
NewConnection
Connections.NewConnection(name: string,--
The name you want to assign to the connection
func: (any) → (any),--
The function to run when the connection is fired
AutoConnect: boolean?--
If true then the connection will automatically connect to the function
) → table--
Returns the table so that it's functions can be called
This is the function that creates the connection.
GetConnection
Connections.GetConnection(Name: string--
The name of the connection you want to get
) → table | nil--
Returns the table so that it's functions can be called or nil, if it isn't found
This connection retrieves a connection that was previously created so it makes it possible to run the connections functions via other scripts
Clean
Connections.Clean() → ()This function cleans up any connections that are in the "trash can", to add connections to the trash can you need to use the :AddToClean() function
Connect
Connects the connection that was made.
Disconnect
Connections:Disconnect() → ()Disconnects the connection if it was previously connected.
Destroy
Connections:Destroy() → ()Cleans up/Destroys the connection that is no longer needed.
AddToClean
Connections:AddToClean() → ()This connection adds said connection to a "trash can" so that when the .Clean() function is ran, all the connections in the "trash can" would be destroyed
ForceRun
Connections:ForceRun(...: any--
any arguments
) → any--
Returns the function data
This function allows you to force run the connection's given function with any arguments
ChangeFunction
Connections:ChangeFunction(newfunc: (any) → any--
the function you want it to update to
) → ()This function updates the connection's previous function to the newly set one.