Problem With Plugin

So I am Having issues. Pretty much the plugin opens but It only opens once. How do I fix this?

local Toolbar = plugin:CreateToolbar("Sign Generator")
local ToolbarButton = Toolbar:CreateButton("Sign Generator!","Create your own custom sign!","rbxassetid://6608493113","Sign Generator!")
local Opened = false
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local Closed = true
local SignWidgetInfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Float,
	false,
	false,
	0,
	0,
	0,
	0
)

local widget = plugin:CreateDockWidgetPluginGui("Sign Generator!", SignWidgetInfo)
widget.Title = "Sign Generator!"

 
script.Parent.PluginGUI.Parent = widget 

ToolbarButton.Click:Connect(function()
	if Opened then
		widget.Enabled = false
	else
		widget.Enabled = true
		Opened = true
	
	end
end)
2 Likes
ToolbarButton.Click:Connect(function()
	widget.Enabled = not widget.Enabled
    -- basically, disables if it's enabled and enables if it's disabled
end)
2 Likes

Im almost 100% sure this is where I am messing up at.

1 Like