Disconnect (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Flurite
No edit summary
>Legend26
Redirected page to RBXScriptSignal#Methods
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>{{Method
#REDIRECT [[RBXScriptSignal#Methods]]
|name = disconnect
|description = Disconnects a function from an event so it is no longer active.
|object = Event
}}
 
{{clear floats}}
 
{{Example|
Below is an example of connecting a function and then disconnecting it.
<pre>
local Connection = script.Parent.Touched:connect(function()
print("Hit")
end)
 
Connection:disconnect() --the function will no longer print "Hit" when the script's Parent is touched.
</pre>
}}[[Category:Methods]]
 
There's also a method name Disconnect in [[CustomEvent]].
</noinclude>
 
{{AdminOnlyMethod
|name=Disconnect
|arguments=[[CustomEventReceiver]] ''receiver''
|description=Disconnects the ''receiver'' from the [[CustomEvent]].
|object=CustomEvent}}

Latest revision as of 00:49, 21 March 2012