getconnections
The getconnections function is used to get connections that are connected to the provided Signal
function getconnections(signal: RbxScriptSignal): {[number]: ConnectionProxy}
do -- in another script
local workspace: Workspace = workspace;
workspace:GetPropertyChangedSignal("Gravity"):Connect(function()
print("gravity was changed");
end);
end;
-- our script:
for _: unknown, v: ConnectionProxy in getconnections(workspace:GetPropertyChangedSignal("Gravity")) do
print(v.Function); --> function that is bound
v:Fire(); --> fire this connection
v:Disable(); --> disable this connection
hookfunction(v.Function, function() end); --> disable the function from getting called
end;
This function is useful if you want to have control over connections.
firesignal
The firesignal will fire every connection that is bound to signal
function firesignal(signal: RbxScriptSignal, ...: any): ()
firesignal(workspace.Changed, "Name");
This function is useful if you want to fire a signal
getsignalfunctions
The getsignalfunctions will return function that is connected to Signal
function getsignalfunctions(signal: RbxScriptSignal): {[number]: (...any) -> (...any)}