Need help with Gui Plugin Script

I barely have any experience in making plugins.
So as I know almost nothing, you might probably know everything about plugins.

This is a part of my plugin script that shows the gui

	local ui = script:WaitForChild("ScreenGui")
	ui.Parent = game:GetService("CoreGui")
end)

The problem with this is that the gui can only be shown once when the plugin is clicked
So instead I tried this script:

	local ui = script:WaitForChild("ScreenGui")
        local gui = ui:Clone()
        gui.Parent = game:GetService("CoreGui")
end)

But when I use this part of my script, it seems to stop lots of scripts used in the screengui.

If there is any way you can help me, It will be very appreciated

Thanks for your time.

1 Like