Hello, I’m starting to script lua widgets for my next plugin. For some reason the Dock UI won’t appear anymore as soon as I close it and open it again. I’ve tried making some changes to the code and the design, nothing seemed to work.
The error I keep getting in the “output” window is
19:30:45.877 - This plugin cannot create more than one PluginGui with id: "Ellipse"
19:30:45.878 - Stack Begin
19:30:45.878 - Script 'Plugin_EllipsePlus.rbxmx.Ellipse+.PluginCreator', Line 32 - function MenuShow
19:30:45.878 - Script 'Plugin_EllipsePlus.rbxmx.Ellipse+.PluginCreator', Line 50
19:30:45.879 - Stack End
When the button is clicked, you should change Widget.Enabled to true instead of creating a new widget (which isn’t possible with the same name)
local toolbar = plugin:CreateToolbar("Toolbar")
local button = toolbar:CreateButton("Whatever", "...", "rbxassetid://87654321")
local widget = plugin:CreateDockWidgetPluginGui(info)
button.Click:Connect(function()
widget.Enabled = not widget.Enabled
end)