|
|
(8 intermediate revisions by 2 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}}
| |