I’ve tried to figure it out, but the scripts won’t work.
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float, -- Widget will be initialized in floating panel
true, -- Widget will be initially enabled
false, -- Don't override the previous enabled state
200, -- Default width of the floating window
100, -- Default height of the floating window
200, -- Minimum width of the floating window (optional)
100 -- Minimum height of the floating window (optional)
)
local testWidget = plugin:CreateDockWidgetPluginGui("TestWidget", widgetInfo)
script.gui:Clone().Parent = testWidget
local toolbar = plugin:CreateToolbar("test3")
local newScriptButton = toolbar:CreateButton("test", "test2", "rbxassetid://2062911925")
local function onNewScriptButtonClicked()
if testWidget.Enabled == true then
testWidget.Enabled = false
else
testWidget.Enabled = true
end
end
newScriptButton.Click:Connect(onNewScriptButtonClicked)
It clones the GUI into the DockWidgetPluginGui perfectly fine. The problem is, it doesn’t clone the scripts, so it doesn’t do anything.
EDIT: I did a GetDescendants for loop, and the scripts were cloned, they just don’t work??
