Disconnect (Method)

From Legacy Roblox Wiki
Revision as of 14:10, 26 December 2010 by >MrNicNac (New page: <onlyinclude>{{Method |name = disconnect |description = Disconnects a function from an event so it is no longer active. |object = Event }}</onlyinclude> {{clear floats}} {{Example| Below...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
disconnect( )
Returns nil
Description: Disconnects a function from an event so it is no longer active.
Member of: Event


Example

Below is an example of connecting a function and then disconnecting it.

local Connection = script.Parent.Touched:connect(function()
print("Hit")
end)

Connection:disconnect()