How to make a plugin! 2022

Hello today I will be showing you how to make a plugin in 2022!
New Project - 2022-05-16T170328.989
Please this took a while to make!
Okay so time for the tutorial

Create a new folder inside of ServerScriptService.
Screen Shot 2022-05-16 at 4.33.37 PM
Then create a new script in that folder.
Screen Shot 2022-05-16 at 4.34.06 PM
Rename the folder to your plugins name or something you can remember.
Screen Shot 2022-05-16 at 4.34.27 PM
If you want to you can rename the script to something.
Screen Shot 2022-05-16 at 4.35.07 PM
Create a new ScreenGui in StarterGUI.
Screen Shot 2022-05-16 at 4.35.38 PM
Rename this Gui to UI or anything you want, this name will come up later.
Screen Shot 2022-05-16 at 4.36.15 PM
Create a new frame inside the GUI you just created.
Name this anything you want but this will also come up later.
Screen Shot 2022-05-16 at 4.36.45 PM
Download the AutoScale Lite plugin.
(this will make your GUI work on all sizes of screens.)
Screen Shot 2022-05-16 at 4.37.36 PM
Now select the blue icon and this menu will pop up.
click scale for both.
Screen Shot 2022-05-16 at 4.37.51 PM
Create a new Text button or image button.
You can rename the buttons and the name will come up later.
On the button use the Auto Scale Light plugin again with the same steps.
You can now customize you Gui.
Screen Shot 2022-05-16 at 4.38.21 PM
Put the Gui into the script we made.
Screen Shot 2022-05-16 at 4.40.50 PM
You will have to edit the script, the script explains what you will change.

local toolbar = plugin:CreateToolbar("Toolbar name") -- change to name of plugin
local newScriptButton = toolbar:CreateButton("Button name", "description", "image") -- change to text and for "image" use the image id not the decal id.
local materials = Enum.Material:GetEnumItems()
local Camera = workspace.CurrentCamera
newScriptButton.Click:Connect(function() -- when the button in the plugins tab is pressed
	if script:FindFirstChild("UI") then
		script.UI.Parent = game:WaitForChild("CoreGui")
		game.CoreGui:WaitForChild("UI").Bar.Button.MouseButton1Click:connect(function() -- you will have to change Bar.Button to your ui names in the UI.
			local part = Instance.new("Part") -- this is the part were you can make what you want to do happen when the button is pressed.
			part.Parent = game.Workspace
		end)
	else
		game.CoreGui:WaitForChild("UI").Parent = script -- hides the UI
	end
end)


Now publish your plugin.
To save a plugin that you do not need to instal called a local plugin just press Save as local plugin.

9 Likes

Iā€™d recommend showing how to add a local plugin.

5 Likes

I highly recommend using a variable for the UI. Please, also clean your code with ternary

local toolbar = plugin:CreateToolbar("Toolbar name") -- change to name of plugin
local newScriptButton = toolbar:CreateButton("Button name", "description", "image") -- change to text and for "image" use the image id not the decal id.
local materials = Enum.Material:GetEnumItems()
local Camera = workspace.CurrentCamera
local UI = -- path to UI
local coreGui = game:GetService("CoreGui")
newScriptButton.Click:Connect(function()
    UI.Parent = UI.Parent == script and coreGui or script
end)
UI.button.MouseButton1Click:Connect(function()
--code
end)

also why make variables you dont need and why not make variables when u need them?

Yea sorry I reuse script from my old plugins.

(Post deleted)
Replied to a wrong user sorry

Its better to disable archivable for ui