PluginToolbar

Show Deprecated
Not Creatable

A PluginToolbar is an object created by using the Plugin:CreateToolbar() method. It is used to create PluginToolbarButtons using the CreateButton function. In general, it is good practice for a plugin to use one and only one uniquely named toolbar for all of its buttons. In Roblox Studio, toolbars are rendered under the Plugins tab.

A screenshot of Roblox Studio's Plugins tab, rendering several PluginToolbars

Pictured above are three PluginToolbars in Roblox Studio: Animations, Three Wise Monkeys and Localization. The center toolbar is a custom toolbar created by a plugin; the other toolbars are created by built-in Roblox Studio plugins.

Example

The following code sample creates a basic toolbar with one button. It should be run as a Roblox Studio plugin, and not run as a Script.


1local toolbar = plugin:CreateToolbar("Three Wise Monkeys")
2local button = toolbar:CreateButton("Mizaru", "See No Evil", "rbxassetid://2778270261")
3

Summary

Properties

Events

Methods

CreateButton(buttonId: string, tooltip: string, iconname: string, text: string): Instance  

Creates PluginToolbarButton that allows the user to initiate a single, one-off action in Roblox Studio through the Click event.

Properties

Events

Methods

CreateButton

Plugin Security

Creates PluginToolbarButton that allows the user to initiate a single, one-off action in Roblox Studio through the Click event.

Parameters

buttonId: string

A unique button Id.

tooltip: string

The text displayed in the tooltip shown when a user hovers over the button.

iconname: string

The asset Id (e.g. rbxassetid://1507949215) of the icon displayed in the button.

text: string

Text displayed under the button icon. Optional. If this field is not provided, the Id will be used instead.

Default Value: ""

Returns

The created PluginToolbarButton instance.

Code Samples

Adding a Plugin Toolbar Button

1local ServerScriptService = game:GetService("ServerScriptService")
2
3local toolbar = plugin:CreateToolbar("Empty Script Adder")
4local newScriptButton = toolbar:CreateButton("Add Script", "Create an empty Script", "rbxassetid://1507949215")
5
6local function onNewScriptButtonClicked()
7 local newScript = Instance.new("Script")
8 newScript.Source = ""
9 newScript.Parent = ServerScriptService
10end
11
12newScriptButton.Click:Connect(onNewScriptButtonClicked)