Scripting Skills 001: Plugins

Well-come, IMAGIN€£R$! We will do a lesson on making plug-ins! First, we will do an advert-style intro!

Bored of having broken plug-ins? Wanna have the ability to make your own without the £ and R$ spent on asking someone else to do it for you? Well, look no further, introducing the Export As Plugin button! Just make a script, then using right-click-on-the-object-in-Explorer technology, you can just press the button, and off you go!

To first activate a new plug-in you made, you have to install it yourself in Studio! To update, go to the plug-in manager in the Plugin tab (who still uses the SystemMenu). Then, scroll down to your plugin, and press Update. Don't forget, Plug-ins work when a new Studio tab is opened. This is to make sure that you don't just try to run it.

To note, there is a new global variable in the script when a plugin works: plugin. Using plugin, you can access the plug-in (when I use a dash, it refers to the plugin itself, not the variable) and its methods! Some of them include Plugin:GetMouse(), Plugin:Union(array parts), and Plugin:Separate(UnionOperation), oh, and did I forget Negate(array parts)? Oh, of course not!

Finally, we'd like to point out that using Plugin:CreateToolbar(string title)

makes a tool-bar in the Plugin tab. After that, you obviously have to make a Button instance using Plugin:CreateButton(string text, string tooltip, string iconname) to make the button. We have a plagiarised example from the Rōblox wiki!

local PluginManagerObject = PluginManager()local Plugin = PluginManagerObject:CreatePlugin()local Toolbar = Plugin:CreateToolbar("Hello World Plugin Toolbar")local Button = Toolbar:CreateButton("Print Hello World", "Click this button to print Hello World!", "rbxassetid://133293265")

See the script that I just stole from the wiki, it makes a new plug-in. Since you haven't realised yet that PluginManager():CreatePlugin() is deprecated, as is PluginManager() itself. I have to tell you that the script has deprecation issues! So, we use our Mouskatools

! Yes, that was a Disney reference. Any-way, we are going to use the Studio Mouskatool for opening up the script. After that, we stumble then find the keyboard (and mouse) in our Mouskatools to navigate through the script! Finally, we become so stumped and so lost that we have to call in Snapcash to help. He will guide you, so that you may eventually type this:

local Plugin = plugin local Toolbar = Plugin:CreateToolbar("Hello World Plugin Toolbar")local Button = Toolbar:CreateButton("Print Hello World", "Click this button to print Hello World!", "rbxassetid://133293265")

So, we have finished the script. Now it must look like a useless button that is supposed to print Hello World, but apparently has no events connected to it. If you need help in events, TOO BAD!

Snapcash, the Windows 10 OS!