This topic is a bit related to my earlier question How can I disconnect a function?, but now I am wondering what is :disconnect(), I've seen it a few times in a script, but not too sure how it works, or how it is used for what purpose.
COMMUNITY QUESTION
What is :disconnect() used for?
1 answer
:disconnect() is used to disconnect events that were connected. Basically, if you had an event that called a function, and you used the disconnect method on the event, the function will no longer be called when the event fires. In order to use it, that even has to be assigned to a variable, like so:
Connection = Part.Touched:connect(onTouch) --Connects the Touched event to the function onTouch
wait(5)
Connection:disconnect() --Disconnects the event
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
In what way is the second segment incorrect? The two are equivalent except for global/local scope.
Nevermind, I just tested it and it works, so I edited my answer and removed that part