Plugins are scripts that run inside Studio and give you access to services regular game scripts cannot touch, like Selection and ChangeHistoryService. This guide covers the basics of creating a plugin, adding a toolbar button, and publishing it for your team.
What a plugin is
A plugin is a Script parented into Studio's plugin folder. It gets a
Code: Select all
pluginCreating your first plugin
1. Insert a new Script inside ServerStorage and name it something descriptive, like "ScriptInserter".
2. Paste in a basic toolbar creation:
Code: Select all
local toolbar = plugin:CreateToolbar("My Tools")
local button = toolbar:CreateButton("Insert Script", "Inserts an empty Script", "rbxassetid://14978048121")
button.ClickableWhenViewportHidden = true
button.Click:Connect(function()
local selection = game:GetService("Selection"):Get()
local parent = selection[1] or game:GetService("ServerScriptService")
local script = Instance.new("Script")
script.Parent = parent
end)
4. Click Save in the popup. The plugin now lives in your local Plugins folder and runs every time Studio starts.
Testing and reloading
Enable Plugin Debugging in Studio's settings under the Studio tab. This exposes PluginDebugService, which lets you reload plugins without closing Studio. Right click a plugin in PluginDebugService and select "Reload Plugin" to test changes. To save and reload at once, use "Save and Reload Plugin".
Adding undo support
Any plugin that modifies the DataModel should wrap its changes in ChangeHistoryService recording:
Code: Select all
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local success = ChangeHistoryService:TryBeginRecording("Insert Script", "Insert Script")
if success then
-- make your changes here
ChangeHistoryService:FinishRecording("Insert Script", true)
else
warn("Another recording is already open")
end
Publishing to the Toolbox
Once the plugin works the way you want:
1. Right click the script in Explorer.
2. Select Publish as Plugin.
3. Fill in the name, description, and icon.
4. Submit.
The plugin now appears in your Toolbox under Inventory and Creations, ready to use across all your projects.
Source
[1] Roblox Creator Documentation: Studio Plugins
[2] Plugin class reference on the Roblox Creator Hub