On the Developer Hub article here, it states that events should always be disconnected when no longer needed. Yesterday, I went through all the scripts in my game to see if any events were connected for longer than necessary.
However, since I am new to programming with Lua, I had trouble figuring out how I would reconnect a previously disconnected event if I needed it again, or whether some events should event be disconnected at all.
For example, I have many .Touched events that I want to fire every time the corresponding part is touched by a player. Wouldn’t disconnecting and later reconnecting each of these events require another event, defeating the purpose of the first event?
My question is, how many is too many? As in, when will the number of connections start having negative effects on the client or the server? Should I find every way to disconnect connections possible, or should I not bother about it?