Plugin script safe uninstall help, How to destroy ScreenGui

Help me handle safe uninstallation of my plugin
So I have a Screen Gui under my plugin script

Screenshot 2025-02-01 213918

When the plugin button gets clicked, the ScreenGui is placed inside coreGui and when the plugin button is clicked again, the ScreenGui is placed back under the script again

When the plugin gets uninstalled while this GUI is still inside the CoreGui, the Gui stays there until reopen the studio game

how do I destroy all gui related to this plugin when someone uninstall it

You can bind to the Plugin.Unloading event.

1 Like

nice thank you, that’s what I’ve been searching for since .Destroying or .Deactivation methods didn’t work

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