With a script.Destroying:connect() event in a script, if any parent or ancestor of the script is destroyed, the event won’t fire. But this can be fixed by changing the event to be for the script’s parent/ancestor that is destroyed (ex: Character.Destroying:connect() instead)
However, if the player leaves, the Character.Destroying:connect() event will not be fired fast enough for the script to receive the event before it is destroyed. Same thing happens with a PlayerRemoved event by the same script inside the character.
Is there any workaround to this to make sure that the script within a player’s character can execute something when the character is destroyed from the player leaving?