Tutorial:Making a Plugin

In Roblox, Plugins are tools created by developers. However, these tools can only be used in ROBLOX Studio, NOT in game. An example is Load Character, made by. But, how is a plugin actually made? Tools were created by ROBLOX in order to make these studio-only features. Lets start.

The Plugin object
All Plugins are ran by a. All LocalScripts are disabled in plugins. There is a special keyword that can ONLY be used in scripts managing plugins. This keyword is called 'plugin', and it returns a object.

A Toolbar
The first thing you want to do is make a. A Toolbar is an object that s are stored on. A toolbar can be made using the following code. The name is displayed as the toolbar's name. If a toolbar with the given name has already been created by another plugin that the user has installed, this function will return that toolbar instead of creating a new toolbar.

A Button
Now that we got our toolbar, we need a button on it. To create a button, we use the CreateButton function of the toolbar. In the code above, text is the text that is displayed if no iconName is given. tooltip is the text that shows when the button is hovered over, and iconName is the Content of the icon. Now we have our button, but we need to make it do something. In this example, we are going to make our button print "I was opened!" when it was opened and "I was closed!" when it was closed. 'button' comes with 1 function and 1 event. The function, called "SetActive" is a display function that will make it appear on/off, while the event, "Clicked" is fired when the button is clicked.

The Code
We are going to need a new variable, called "open", since ROBLOX does not record this for us. Now, we will make our event hook up to our function. Whenever the button is clicked, it will check to see what the variable "open" is, and it will invert it, and print the proper print statement.