Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do i disconnect events?

Asked by 5 years ago

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

0
That's weird, did it just start recently? It's working for me. TheeDeathCaster 2368 — 5y

1 answer

Log in to vote
1
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

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()
Ad

Answer this question