Intro to Plugins
Intro to Plugins
A plugin is a custom add-on to Studio which adds new behavior and features that are not normally included. Both the articles/using animation editor|Animation Editor
and articles/Intro To Terrain|Terrain Tools
were originally developed as plugins. There are also many plugins made by the Roblox community that you can use to help make games and experiences.
Finding and Managing Plugins
You can find new Studio plugins and manage/update your installed plugins through the Manage Plugins button in the Plugins tab.


- Find Plugins — Find new plugins to install.
- Active — Toggles whether the plugin is active or not.
- Remove — Uninstalls the plugin.
- Update — Gets the latest version of the plugin.
Creating New Plugins
In addition to using pre-built plugins, you can create your own plugins to make development easier. In this section, we’ll create a simple plugin that lets you insert new scripts into a game without the default “Hello world!” print function.
- All plugins start from a
Script
, so create a new script instance inside ServerStorage. - Name the script EmptyScriptAdder.

- Right-click on the script and select Save as Local Plugin.

- Click Save. This will insert the plugin into your plugins folder.

That was actually the plugin running for the first time! Whenever you save a plugin in this way, all of your plugins will refresh and run.
Adding a Toolbar Button
Buttons are a great way to get input from the user. Let’s change our plugin so that it adds a button to the Studio toolbar which inserts a new script into the game.
First, we need to make a toolbar to hold the button. For that, we’ll use the Plugin/CreateToolbar|Plugin:CreateToolbar()
function. We can then call the Toolbar/CreateButton|Toolbar:CreateButton()
function on that object to insert a custom button for the plugin.
- Open the EmptyScriptAdder script and delete
print("Hello world!")
. - Copy and paste the following code into the script:
local toolbar = plugin:CreateToolbar("Empty Script Adder") local newScriptButton = toolbar:CreateButton("Add Script", "Create an empty Script", "rbxassetid://1507949215")
- Save the plugin as before (right-click the script and select Save as Local Plugin). After this you’ll see the button in the Plugins tab of Studio.

- The button doesn’t do anything yet, so let’s add some new code to have the button insert a
Script
instance and use theScript/Source
property to change its default content:
local toolbar = plugin:CreateToolbar("Empty Script Adder")
local newScriptButton = toolbar:CreateButton("Add Script", "Create an empty Script", "rbxassetid://1507949215")
local function onNewScriptButtonClicked()
local newScript = Instance.new("Script")
newScript.Source = ""
newScript.Parent = game:GetService("ServerScriptService")
end
newScriptButton.Click:Connect(onNewScriptButtonClicked)
- Once again, save the plugin through Save as Local Plugin. Now if you click the Add Script plugin button, it will insert a new
Script
into ServerScriptService. Best of all, the new script doesn’t have theprint("Hello world!")
command at the top!

Supporting Undo/Redo
When building a plugin that makes changes to a place, it’s important to make sure that the plugin works well with the Studio undo/redo feature.
Undo and redo in Studio are managed by waypoints in ChangeHistoryService
. After every action in Studio, such as the user dragging a part or inserting something new, Studio automatically adds a new waypoint. When you undo an action, Studio goes back to its last waypoint and undoes everything that happened after that waypoint.
The catch with plugins is that they do not add any new waypoints by default. If a plugin makes a change to a place and the user clicks Undo, Studio will go back to the last place it had a waypoint, meaning it will undo the last non-plugin action and all the things the plugin did.
All we need to do to make sure that Studio can cleanly undo our plugin’s action is:
- Add a local variable for
ChangeHistoryService
calledChangeHistoryService
. - Call
ChangeHistoryService/SetWaypoint|SetWaypoint()
in the final line of theonNewScriptButtonClicked()
function.
local ChangeHistoryService = game:GetService("ChangeHistoryService") local toolbar = plugin:CreateToolbar("Empty Script Adder") local newScriptButton = toolbar:CreateButton("Add Script", "Create an empty Script", "rbxassetid://1507949215") local function onNewScriptButtonClicked() local newScript = Instance.new("Script") newScript.Source = "" newScript.Parent = game:GetService("ServerScriptService") ChangeHistoryService:SetWaypoint("Adding new empty script") end newScriptButton.Click:Connect(onNewScriptButtonClicked)
ChangeHistoryService/SetWaypoint|SetWaypoint()
after every step that you want to let the user step back to with Undo.
Sharing Plugins
There are two ways to share a plugin with others: by sending them the Lua script file, or by publishing the plugin to Roblox.
Share Locally
When you save a plugin through Save as Local Plugin, Studio saves it to your Plugins folder automatically. If you want to share a plugin that you made, you can find the saved file there — just navigate to the Plugins tab in Studio and click Plugins Folder to open the folder with all of your locally installed plugins.

Once you open the folder, you can copy the script file for your plugin and give it to others. They can then place the script file into their own Plugins folder.
Publish to Roblox
Just like places and models, plugins can be published to Roblox to make them easy to share and install. To publish a plugin:
- Right-click on the plugin script in Studio and select Publish as Plugin.
- Publish to a new slot or update one of your existing plugins.
- Enter a name and description for the plugin.
- Click Finish. Once the plugin has finished publishing, you’ll be given a link which you can share with anyone you want to have the plugin.
Other Plugin Examples
Insert Empty Folder
Many plugins use the Selection
service to find out what objects the user has selected. The following script introduces a new button that checks if the user has anything selected and, if so, adds a folder to that selection.
local ChangeHistoryService = game:GetService("ChangeHistoryService") local Selection = game:GetService("Selection") local toolbar = plugin:CreateToolbar("Folder Tools") local createFolderButton = toolbar:CreateButton("Create Folder", "Create a new folder", "rbxassetid://1581292991") local function onCreateFolder() local selectedObjects = Selection:Get() local parent = game.Workspace if #selectedObjects > 0 then local firstSelection = selectedObjects[1] parent = firstSelection end local newFolder = Instance.new("Folder") newFolder.Parent = parent Selection:Set({newFolder}) ChangeHistoryService:SetWaypoint("Adding new folder") end createFolderButton.Click:Connect(onCreateFolder)