A plugin is an extension that adds additional features or functionality to Studio. You can either find, install, and manage community-made plugins from the Creator Marketplace, or you can create and publish your own to the Toolbox to use across your experiences. If you choose to also publish your plugins to the Creator Marketplace for creators to use within their own development processes, you can either offer them for free or sell them for Robux.
Creating New Plugins
You can create your own plugins to improve your workflow in Studio. The following code sample is a plugin called EmptyScriptAdder that inserts an empty script as the child of an object or in ServerScriptService. The following sections explain the major parts to creating this plugin.
1local ChangeHistoryService = game:GetService("ChangeHistoryService")2local Selection = game:GetService("Selection")34-- Create a new toolbar section titled "Custom Script Tools"5local toolbar = plugin:CreateToolbar("Custom Script Tools")67-- Add a toolbar button named "Create Empty Script"8local newScriptButton = toolbar:CreateButton("Create Empty Script", "Create an empty script", "rbxassetid://4458901886")910-- Make button clickable even if 3D viewport is hidden11newScriptButton.ClickableWhenViewportHidden = true1213local function onNewScriptButtonClicked()14 local selectedObjects = Selection:Get()15 local parent = game:GetService("ServerScriptService")16 if #selectedObjects > 0 then17 parent = selectedObjects18 end1920 local newScript = Instance.new("Script")21 newScript.Source = ""22 newScript.Parent = parent23 ChangeHistoryService:SetWaypoint("Added new empty script")24end2526newScriptButton.Click:Connect(onNewScriptButtonClicked)27
Saving a Plugin Script
Insert a new Script inside ServerStorage and rename it to EmptyScriptAdder.
Copy and paste the EmptyScriptAdder Plugin code into the new script.
Right-click the script in the Explorer and select Save as Local Plugin.
In the popup window, click Save to insert the plugin script into your local Plugins folder of the Studio installation. The Output window indicates that the plugin successfully saved and the plugin runs for the first time after you save it.
Adding a Toolbar Button
To add a button for your plugin to the Plugins tab of the Studio toolbar, use the Plugin:CreateToolbar() and PluginToolbar:CreateButton() methods. In the code for EmptyScriptAdder, line 5 creates a new section in the toolbar named Custom Script Tools and line 8 creates a button named Create Empty Script.
Executing Code on Click
To make the plugin execute code when a user clicks the toolbar button, connect a function to the button's PluginToolbarButton.Click event. In the code for EmptyScriptAdder, the connecting function is onNewScriptButtonClicked.
Checking User Selection
To modify a plugin's behavior based on what the user has selected, use the Selection service. The onNewScriptButtonClicked function checks if the user has anything selected and creates the new script as its child instead of inside ServerScriptService. If the user doesn't have anything selected, it creates the new script in ServerScriptService.
Supporting Undo and Redo
To give users the ability to undo and redo changes that a plugin makes, set waypoints using the ChangeHistoryService. After every action in Studio, such as dragging a part or inserting a new object, Studio automatically adds a new waypoint. When you undo an action, Studio returns to a previous waypoint and undoes everything that happened after that waypoint.
Plugins don't add new waypoints by default. If a plugin makes a change to a place and the user activates Undo, Studio undoes the last non-plugin action and everything the plugin did. To make sure Studio cleanly undoes a plugin's action, call the ChangeHistoryService:SetWaypoint() method after performing an action. In the code for EmptyScriptAdder, line 23 calls ChangeHistoryService:SetWaypoint() and passes a string description for the waypoint.
As with models, meshes, images, and animations, you can publish plugins to Roblox to make them easy to reuse from the Toolbox. In addition, you can give other creators the ability to purchase and/or install your plugins by publishing them to the Creator Marketplace. The minimum amount you can sell plugins is 100 Robux.
To publish a plugin:
In the Explorer window, right-click on the plugin script you want to publish to Roblox. A contextual menu displays.
Select Publish as Plugin. The Asset Configuration window opens.
(Optional) In the upper-left corner of the window, click the image to upload a 512×512 image.
Fill in the following fields:
- Title: A name for your plugin.
- Description: A description that describes what a potential user should expect the plugin to do.
- Creator: The creator you'd like to attribute as the creator of the plugin. If you are using Team Create, every creator appears, otherwise "Me" is the only option.
(Optional) Enable the Distribute on Marketplace toggle to publish your plugin to the Creator Marketplace. The Price field becomes enabled.
(Optional In the Price field, input the amount of Robux you want to charge for the plugin. If you keep the default value of 0, the plugin will be free to all creators.
Click the Submit button. Your plugin is now available to you in the Toolbox.
To manage a plugin after you install it:
Click the Manage Plugins button in the Plugins tab to open the Plugins Management window.
For the plugin you want to manage, use the following options.
- Update – Update the plugin to its latest published version. If this button isn't visible, the plugin is up-to-date.
- Active – Toggles whether the plugin is active or not.
- Details / Uninstall – Opens a menu to view the plugin's details or uninstall it.