Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i disconnect events?

Events are stacking in my script and i cant use disconnect() because it is deprecated and i tried using Disconnect() to but it also deprecated for some reason even though the wiki sayes it isnt

1 comment

0

That's weird, did it just start recently? It's working for me.

1 answer

Declare the event connection as a variable, then use Disconnect() on it, like this:

local ev = workspace.ChildAdded:Connect(function(blabla)
	--blabla
end)

--later
ev:Disconnect()

This discussion is preserved as it was. New answers, comments, and votes are closed.