Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you use Dock Widgets for plugins?

I'm fairly new to plugin development and I'm having some trouble with the new DockWidgetPluginGui thing where it creates pop out windows, I'm trying to make a personal plugin where I can edit properties of a part as a test because I'm working on my first plugin, but I don't know how to make it so the window is visible when they click the button.

So far, I have it to where it shows up in the toolbar with the button there and an image but it creates the window when I load up studio, how do I make it so when you click the plugin button it shows the docked window and when you click it again it will close? I don't think there is a property of it called 'Visible' like regular frames and I'm stumped.

local toolbar = plugin:CreateToolbar('')
local button = toolbar:CreateButton('Property Adjuster', 'Adjusts properties.', 'rbxassetid://208075646')

local ChangeHistoryService = game:GetService('ChangeHistoryService')

local info = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Float,
	true,
	false,
	250,
	250,
	250,
	250
)

local interface = plugin:CreateDockWidgetPluginGui(
	'Property Adjuster',
	info
)

button.Click:Connect(function()
	
end)

1 answer

✓ Accepted answer

Hi!

To make the Dock widget toggle, simply change the Enabled property of the dock widget that you create.

button.Click:Connect(function()
	interface.Enabled = not interface.Enabled
end)

This should toggle the UI. Keep in mind that you will also need to insert UIs into the dock widget later.

Hope this helped, make sure to accept my answer if it did.

2 comments

0

Don’t remind people to accept your answer, because if you helped them, it’s nature to accept the answer. You’re just greedy for reputation.

0

Alrighty Incapaz, you can stop commenting on all my posts now. :)

This discussion is preserved as it was. New answers, comments, and votes are closed.