Welcome To Robloxia - Plugins

Welcome To Roblox

Part 2 - Plugins


Hey there fellow developers, before we begin I would like to say later today the Welcome To Robloxia part one page will be updated, aswell as this I hope you enjoy this tutorial and that it shall let you udnerstand the basics and advanced mechanics of Roblox plugins, shall we begin?

NOTE BEFORE WE BEGIN

If you haven’t checked out part one we recommend doing so as it includes how to navigate the studio enviroment and lots of other things you need for this tutorial.

:warning: - Part One

:briefcase: - Official Plugin Documentation


Creating A Plugin


Now the first step in plugin development is obviously creating a place to store your plugin, so create a folder within ServerStorage and name it whatever you like, in this case we will call it 'pluginFolder'.

(Do not worry if your studio icons/design does not look the same, you can use any theme you want (I use Vanilla Icons))

Now this folder will contain all the content of our plugin and will act as our plugin’s container, so I recomend naming it the same as your plugin such as ‘Studio Designer’, now that we have established the folder add a script inside of it an call it something like ‘pluginManager’.

Now right-click on your folder and click ‘Save As Local Plugin’ and name the plugin anything you want, once you do if you see “Hello World” in the ouput bar then congratulations you have your first plugin, if not then re-follow these steps.


Toolbar


Now that we have setup our plugin let’s move on to creating a Toolbar, this is where your user can open/close and configure your plugin as you allow them, on the previous screenshot you can see the plugins at the top each black line seperates a plugin’s toolbar, now let’s create on of our own. In your script insert the following code -

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

Now if you save the plugin(right-click folder press save as local plugin and use same name as last time and overide your plugin) you should see your plugin name there!

Now let’s add a button to your plugin, first up we need an image to display so go to your developer dashboard here and upload any image you want and save or search the Creator Marketplace for images and copy there ID (Credit to Vanilla Icons who’s icons I will be using today).

Now insert the following code to create a new button -

local myPluginBtn = myPluginToolbar:CreateButton('Script','Insert a regular script into serverScriptService','rbxassetid://9778489793')

The first Argument is the text you want displayed below the image, the second is the description or text displayed when hovering over the image, and the last is the Asset Id, make sure it is not the DECAL ID and it is ASSET ID and the ASSET ID comes after the rbxassetid://

To get the Asset Id copy the following screenshot -


(click the weird icon between the three dots and download icon and then click on the ‘Decal’ option and copy the numbers at the end of the Texture property!

Save your plugin and congrats, the button is setup, now time for functionality!

First we need to create a function to run when the button is clicked, let’s call it onBtnOneClick and then we want to add a script which prints ‘We have learned through the Welcome To Robloxia Series’ when run and is located in ServerScriptService so let’s do that -

local function onBtnOneClick()
	local scripto = Instance.new("Script")
	scripto.Source = "print('I have learned through the Welcome To Robloxia Series')"
	scripto.Parent = game:GetService("ServerScriptService")
end

And now to run that function when the button is clicked insert -

myPluginBtn.Click:Connect(onBtnOneClick())

(If you don’t understand this check out Welcome To Robloxia part one)
Save and run and it should put a new script in ServerScriptService which contains the code to print the wanted string, congrats on making your first plugin function!


NOTE - this plugin will be published to #resources:community-tutorials once completed, it is only located here while drafting this post since my drafts keep posting, so this is to keep the project hidden until done, otherwise it would be flagged for not enough info, please dont flag this post while it is in #bulletin-board , please

1 Like