Combining Different plugins' buttons into one ToolBar

Some people can’t union the plugin buttons in one toolbar (before this topic, me too) and I say you, how to do it!

Find or Create ToolBar system

Copy and paste this lines:

local toolbar
if game.CoreGui:FindFirstChild("MyToolBar") then
	toolbar = game.CoreGui:FindFirstChild("MyToolBar").Value
else
	toolbar = plugin:CreateToolbar("ToolBar")
	local SharedToolBar = Instance.new("ObjectValue")
	SharedToolBar.Value = toolbar
	SharedToolBar.Name = "MyToolBar"
	SharedToolBar.Parent = game.CoreGui
end

Replace “MyToolBar” with custom, “ToolBar” with your toolbar name.

11 Likes

Would you mind explaining I don’t understand anything

E.g.: You have a 2, more plugins and u want place they in one group

1 Like

Maybe show an image for people that don’t understand what your talking about?

This is pretty smart, nice!

The only thing I’m not sure of is whether you’d be allowed to make an instance under CoreGui with a plugin (I’ve never tried so idk).

Most plugins do actually.
image

1 Like

Oh, Damn roblox doesn’t have support to get a toolbar, this is one hella hack behind it, i’ll be using it from now on lol. Thanks.

yep. that’s how plugins used to work before widgets were a thing! you still see it in plugins like moon animator, find/replace materials, etc. a widget isn’t always necessary


@Staric14 you can actually parent the toolbar directly to wherever and rename it; you don’t necessarily need an ObjectValue for this. alternatively, I believe _G works too if you didn’t want to expose the toolbar Instance at all


toolbars used to combine (Studio v1 I believe), but they changed that behaviour, which is annoying sometimes

2 Likes

ObjectValues can be very problematic (when it comes to storing toolbars), so just store the toolbar in CoreGUI without any intermediary.

I made a module which handles toolbars so that you can easily combine buttons in toolbars from different plugins. You can find it on github here:

2 Likes

I think they do that because you might not be able to parent the toolbar. How are they problematic?

I had many issues detecting if the toolbar was a valid instance or not by using an object value (which caused plugin errors in my output). It’s just better to use it as a regular instance as it runs into less problems.