Plugin DescendantRemoving event firing when closing script

the DescendantRemoving event will fire when simply closing a script

RobloxStudio

Source code

game.DescendantRemoving:Connect(function(descendant)
	print(descendant:GetFullName())
end)
1 Like

Thanks for the report! I filed a ticket in our internal database.

1 Like

Hi,

This is as designed, we will keep this behavior: it is caused by scripts being descendants of the game.

They aren’t exactly being removed, though, right? DescendantRemoving implies that the instance is being removed from the datamodel; which isn’t happening in this case? It would make sense if this was related to a ScriptDocument, which is removed upon closing the script editor, but doesn’t necessarily make much sense for the script itself? Unless scripts are destroyed and re-created upon the editor closing in-which in that case; that needs to be documented because that is odd.

1 Like

You are correct. I’ll put in a feature request for this for you.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.