of     1   

PompeyTheGreat
#58855696Wednesday, November 30, 2011 12:55 AM GMT

Hello everyone, this is a tutorial thread to teach you how to make a simple plugin. I will be teaching you how to make a plugin that when you click the button, a part is created. This will be broken down into 3 chapters. **Chapter 1 - Setting Up the Plugin** **Chapter 2 - Making Stuff Happen** **Chapter 3 - Making it Appear in Roblox Studio** ## CHAPTER 1 ## In this section, you will learn how to set up a plugin and get it ready to be used in edit mode. In order to make and use a plugin, we need to create it first. To do this, we use a special line of code that will create an area for our plugin toolbar to be placed. It looks something like this: > `local plugin = PluginManager():CreatePlugin()` As said before, this will create an are for us to put our plugin holder. Now we need the actual holder, called a "Toolbar". To do this, we use another special line of code. It looks something like this: > `toolbar = plugin:CreateToolbar("Part Creator")` The string in the parentheses is the name of the toolbar. You can name it anything you like. If you want to create multiple plugins in the same toolbar, just create one with the same name. It's that easy! Now we need to create the plugin button. This takes yet another special line of code. The method takes 3 arguments: "text," which is what text the button will have (if you can't use an image), "caption," which is what is displayed when you mouse over the button, and "icon," which is the image displayed on the plugin button. We will learn about how to put icons in later. The code for the button creation is this: > `toolbar:CreateButton("New Part", "Click this to create a new part!", "")` This will create a button that says "New Part", displays "Click this to create a new part" when we hover over it, and will have no icon. That's it for setup. Here is what the whole code should look like: > `local plugin = PluginManager():CreatePlugin() > toolbar = plugin:CreateToolbar("Part Creator") > button = toolbar:CreateButton("New Part", "Click this to create a new part!", "")` Great! Now let's move on to Chapter 2, "Making Stuff Happen" ## CHAPTER 2 ## In this section, you will learn how to make something happen when the plugin button is clicked. This will be a rather short section. An event, called "Click," is triggered when the button is clicked. We harness this event the same way we make functions. > `button.Click:connect(function()` or > function Click() > --script > end > > button.Click:connect(Click) I prefer to use the first method, so that is what you will see in the finished script. Now to create a part, we do it exactly as we would in any other script, with the Instance.new() operator. The code should look something like this: > `button.Click:connect(function() > Instance.new("Part", workspace) > end)` Your full plugin code should now look like this: Great! Now let's move on to Chapter 3, "Making it Appear in Roblox Studio" ## CHAPTER 3 ## Now we are ready to make our plugin appear in Edit mode. First, make a file anywhere on your computer. You can name it anything, but it is common to name it the name of the plugin. Next, copy the proceeding code in a notepad document; ---------- plugin = PluginManager():CreatePlugin() toolbar = plugin:CreateToolbar("Part Creator") button = toolbar:CreatePlugin("New Part", "Click this to create a new part!", "") button.Click:connect(function() Instance.new("Part", workspace) end) ---------- and hit "Save As." Find a place where it says "Save As Type:" and click the dropdown box. Select "All Files (*.*)." Then, save the document in the folder you created. Lastly, open up Roblox Studio. Click "Tools," then hit "Open Plugins Folder." Copy and paste the folder you created into this folder and close Studio and the Plugins folder window. Voila! You have just created your very own plugin. When you edit a place with Studio now, you should see a button that says "New Part" somewhere on the screen. If you click that, a new part will appear! ---------- I hope this has helped anyone who was wondering how to create plugins. Post any feedback or comments, they are appreciated!
PompeyTheGreat
#58856780Wednesday, November 30, 2011 1:07 AM GMT

Bump. #don't judge me
PompeyTheGreat
#58857361Wednesday, November 30, 2011 1:18 AM GMT

Bump with a side of floodcheck, please. ## don't judge me ##
CrasyTrex
#58858028Wednesday, November 30, 2011 1:26 AM GMT

Thanks I have been trying to figure out how to make one for like forever!
PompeyTheGreat
#58860407Wednesday, November 30, 2011 1:51 AM GMT

Bump. ## don't judge me ##
Sublimus
#58860547Wednesday, November 30, 2011 1:53 AM GMT

I already knew how to do this but I read over this and I find that it is alot eaiser to understand than the wiki which is a good thing.But great job!
PompeyTheGreat
#58862932Wednesday, November 30, 2011 2:21 AM GMT

Bump. ## don't judge me ##
PompeyTheGreat
#58875726Wednesday, November 30, 2011 11:51 AM GMT

Bump. ## don't judge me ##
pighead10
#58878501Wednesday, November 30, 2011 2:47 PM GMT

At first glance, that looks like a great tutorial for the scripts inside plugins - this isn't covered in the wiki yet. Unfortunately, the wiki is broken to logged in members at the moment, but as soon as it gets fixed I will put this tutorial on the wiki (with a few minor edits).
PompeyTheGreat
#58895731Wednesday, November 30, 2011 11:21 PM GMT

Bump. @pig Can you give me credit please? ## don't judge me ##
pighead10
#58924322Thursday, December 01, 2011 6:14 PM GMT

Nothing on the wiki, minus Camoy's cookbook, has any author labelled as it's a free and open document. Any writer for the wiki will be able to edit it in any way they like.
PompeyTheGreat
#59200503Wednesday, December 07, 2011 1:01 AM GMT

bump ## don't judge me ##

    of     1