If a script that makes an event listener gets destroyed will the event listener get destroyed automatically or do we manually have to account for each of these?
What about abilities on equipment or weapons? If a weapon gives an ability and then the player equips a different weapon, removing and deleting the previous weapon, what happens to things like castEvent, executeEvent, recoveryEvent etc. that were on the first weapon?
Like these:
ability.castEvent:Connect(OnCast_MyAbility)
ability.executeEvent:Connect(OnExecute_MyAbility)
ability.recoveryEvent:Connect(OnRecovery_MyAbility)
ability.cooldownEvent:Connect(OnCooldown_MyAbility)
ability.interruptedEvent:Connect(OnInterrupted_MyAbility)
ability.readyEvent:Connect(OnReady_MyAbility)
.. or is that only when it is stored in a variable like
myEventListener = player.myEvent:Connect(OnSomethingHappened) ?