Disconnect (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Flurite No edit summary |
>JulienDethurens CustomEvents don't have a disconnect method... |
||
Line 1: | Line 1: | ||
< | <onlyinclude> | ||
{{Method | |||
|name = disconnect | |name = disconnect | ||
|description = Disconnects a function from an event so it is no longer active. | |description = Disconnects a function from an event so it is no longer active. | ||
|object = Event | |object = Event | ||
}} | }} | ||
{{clear floats}} | {{clear floats}} | ||
</onlyinclude> | |||
{{Example| | {{Example| | ||
This is an example of connecting a function and then disconnecting it: | |||
< | <code lua> | ||
local | local connection = script.Parent.Touched:connect(function() | ||
print("Hit") | print("Hit") | ||
end) | end) | ||
connection:disconnect() --the function will no longer print "Hit" when the script's Parent is touched. | |||
</ | </code> | ||
}} | }} | ||
[[Category:Methods]] | |||
Revision as of 07:26, 22 January 2012
disconnect( ) | |
Returns | nil |
Description: | Disconnects a function from an event so it is no longer active. |
Member of: | Event |
Example
{{{1}}}