Disconnect (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens
CustomEvents don't have a disconnect method...
>Legend26
Redirected page to RBXScriptSignal#Methods
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude>
#REDIRECT [[RBXScriptSignal#Methods]]
{{Method
|name = disconnect
|description = Disconnects a function from an event so it is no longer active.
|object = Event
}}
{{clear floats}}
</onlyinclude>
 
{{Example|
This is an example of connecting a function and then disconnecting it:
<code lua>
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.
</code>
}}
 
[[Category:Methods]]

Latest revision as of 00:49, 21 March 2012