How can i create my own plugin?

Hello! Ive been using and seeing others make plugins and i had the question on how do they do it.

Where do you even start? How do you publish one or start creating one. Ive came across the plugin object in scripts but i have absolutely no idea how to start or what it does.

Can anyone help me get in the right direction? Thanks.

it works the same way you publish models to the marketplace / toolbox except you do it with scripts

Literally just publish the script…?

You should start by turning on Plugin Debugging Service, you can do this in Studio Settings (search for it).

It will prompt you to restart Studio, do this. When you next load into a place, create a Folder with a script under it, then right click the folder, then click Save As Local Plugin.... Call it whatever you want.

Make sure to delete the folder you’ve just saved, the next paragraph will explain why

Finally, look under PluyginDebuggingService, you’ll see your new plugin there, this is why you should delete the other folder, so that you dont have two copies of the same codebase.

From here, you can save and reload the plugin as you develop it by right-clicking the plugin itself.

1 Like

Plugins are really just scripts that can run in studio (sort of like the Command Bar). They have their own class and services which are exclusively used for plugin development.

You can start off just by creating script like you would normally do (You may want to put this in ServerStorage so it isn’t running in game).

To create a button that appears in the “PLUGINS” tab, you can first create a toolbar like this

local toolbar = plugin:CreateToolbar("My Plugin")

Then to add a button to the toolbar, you can do toolbar:CreateButton()

local button = toolbar:CreateButton("My Button", "Description here", "rbxassetid://0")

And this button will have its own properties and events, like Click, which can be connected to a function like this

button.Click:Connect(function()
     print("Hello world")
end)

Now we can save this script by right-clicking on it in the Explorer window and selecting either Publish as Plugin... (which will prompt you to publish it to Roblox), or Save as Local Plugin..., which will save it to your files in Roblox’s AppData.
image

If we save it as a local file, then it should now appear as its own button in the “PLUGINS” tab along with any other plugins you’ve installed. By clicking on it, it should print “Hello world” in the output.
image

(Since an invalid image was entered, it’ll appear as an X and have an error in the output)

Of course this is just a simple way to create a very basic plugin with a button and an output. There are a lot more things you can do, like with Widgets and special Services for the Script Editor, themes, and a lot of other things, but this should hopefully give you a basic idea of how they work.

If you want to go more in depth and create an actual plugin, I’d recommend checking out the Docs for some of their guides and here on the forums as well

1 Like

Thanks! You explained everything i was stuck on. Definitely will look into those links.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.