So recently, I have been trying to make a plugin.
But once I clone the screengui and set its parent to CoreGui, the scripts apparently, just stop working?
Here is a sample of the script I am using
local Button = Toolbar:CreateButton("Title","Description","Image")
local c = game:GetService("CoreGui"):GetChildren()
local ui = script:WaitForChild("PluginGui")
local clone = ui:Clone()
Button.Click:connect(function()
for i = 1,#c do
if c[i].Name == "PluginGui" then
c[i]:Destroy()
else
clone.Parent = game:GetService("CoreGui")
end
end
end)
Can someone tell me what I am doing wrong?
Any help would be appreciated.
to specify, the screengui becomes the child of the coregui, and the child of the screengui is a frame, within the frame are textbuttons, and within the textbuttons are the textbutton scripts, so yes.