So, I’m wanting to create a simple plugin that will allow me to change the font of the output window.
whenever I click the button on the toolbar, nothing shows up, when I click it again, I get the error:
" This plugin cannot create more than one PluginGui with id: “Output”](rbxopenscript://www.dummy.com/dummy?scriptGuid=%7B3147EE54-08E8-4064-A1A6-EF55C7664CDE%7D&gst=6#10)"
I’ve looked at the Dev hub, and this error doesn’t seem to appear, so I’m just asking for possible solutions, cause all the YouTube tutorials I watch don’t have this problem cause they aren’t dealing with widgets.
The error message implies that you are trying to create a plugin widget with a widget id that already exists. Try changing the widget id to something else.
Yeah, you can only have one PluginGui with the same name. You can append os.time() or something similar to the “Output” string so that it’s unique each time.
You are creating the Gui for each Event, no wonder this is not working.
Its like this:
You have a box of diamonds in it, then, after the event is finished, you empty the box and want to fill it with diamonds again. You know that’s not the best method (and pretty expensive, you are always buying diamonds lol)? Create it outside the event and manipulate it when you look at it simply by using the .Enabled property, it’s that easy, and that’s how you prevent memory leaking.
local Toolbar = plugin:CreateToolbar("DoctorNO2106")
local isOn = false --new property
local Button = Toolbar:CreateButton("Output", "Output font", "rbxgameasset://Images/Output font")
--Create here your Widget
local DWPINFO = DockWidgetPluginGuiInfo.new( Enum.InitialDockState.Right, true, false, 300, 300, 150, 150)
local Widgit = plugin:CreateDockWidgetPluginGui("Output", DWPINFO)
Widgit.Title = "Change Output Font."
local testButton = Instance.new("TextBox")
testButton.BorderSizePixel = 0
testButton.TextSize = 20
testButton.TextColor3 = Color3.new(1,0.2,0.4)
testButton.AnchorPoint = Vector2.new(0.5,0.5)
testButton.Size = UDim2.new(1,0,1,0)
testButton.Position = UDim2.new(0.5,0,0.5,0)
testButton.SizeConstraint = Enum.SizeConstraint.RelativeYY
testButton.Text = "Enter Font type"
testButton.Parent = Widgit
Button.Click:Connect(function()
isOn = not isOn
DWPINFO.Enabled = isOn
end)