Will an event inside a event fire regardless of super-events condition?

I stumbled across this very weird event glitch. Say that I have this:

EventA.Event:Connect(function()
    EventB.Event:Connect(function()
     print("hello")
end)
end)

Normally, you will have to do this for it to print hello right?

EventA:Fire()
EventB:Fire()

But apparently, I fired EventB without firing EventA and it printed hello. Idk whats going on, i thought you had to satisfy the latter events condition before firing the inner event?

This will make it so that if EventA if ever fired, you add another connection to EventB. This means if you fire EventA twice, then every single time you fire EventB it will print hello twice, and so on.

3 Likes

So if I don’t fire EventA and only fire EventB, would hello still print?

If you only fire EventB then hello will never print, also you never want to set up event connections like this because this can easily cause memory leaks if you don’t disconnect the innner connection, since your creating a new connection every time EventA is fired.

How to disconnect without creating a new variable?

You can’t, whats is the point of doing this anyway?