Do I have to disconnect Event:Wait()

I have been using Event:Wait() instead of setting up actual events for convenience, but does this set up a connection like :Connect() does or is it just a delay? Say it never fires and I have that Event:Wait() in a coroutine so it doesn’t delay the rest of my script, but I’m still confused if it will still take memory or not

All it does is delay, so you will not have to disconnect anything. But yes, if the event never fires, it will continue to yield as long as that script exists.

Ok then this leads me to another question, say I yield that coroutine forever cause it never fires will that lead to any memory leaks?

Yes, that could be classified as a memory leak. Any time you allocate memory and don’t ever free it up, that would be a memory leak. In this case, the items in memory would probably be upvalues or at least other stack info that’s stored for the coroutine.

Hmm ok I’ll just setup events and disconnect them I guess, thanks.

What if I yielded the coroutine itself making it’s status suspended would that prevent the potential memory leak?

I’m not sure. I would assume a suspended coroutine that loses any references could be GC’d properly.

Ok thanks, I’ll continue to test this.