I have been having this issue when I change the parent of a screen gui to core GUI it makes 2 copies so there is 2 screenguis of the same thing in coregui. This is messing up a lot of stuff. Any help is great! Thanks! Code Below:
local Toolbar = plugin:CreateToolbar("name")
local Button = Toolbar:CreateButton("name", "name", "", "name")
local CoreGui = game:GetService("CoreGui")
local mainscreen = script.Parent
mainscreen.Parent = CoreGui
mainscreen.Enabled = true
main.NotificationUIText.Visible = true
main.NotificationUIText.Text1.TextTransparency = 1
main.NotificationUIText.Text2.TextTransparency = 1
Button.Click:Connect(function()
mainscreen.Enabled = not mainscreen.Enabled
end)
When dealing with UI in plugins, try organizing your plugin like this:
and reference the UI Folder like this:
local Toolbar = plugin:CreateToolbar("name")
local Button = Toolbar:CreateButton("name", "name", "", "name")
local CoreGui = game:GetService("CoreGui")
local opened = false
Button.Click:Connect(function()
opened = not opened
if opened == true then
local UIFolder = script.Parent.UI:Clone()
UIFolder.Name = "Your UI Folder Name"
UIFolder.Parent = CoreGui
local ScreenGui = UIFolder.ScreenGui
else
local SpawnedUIFolder = CoreGui:FindFirstChild("Your UI Folder Name")
if SpawnedUIFolder then
SpawnedUIFolder:Destroy()
end
end
end)