Is there a guide to creating a gui plugin?

Hey Devs! I wonder if there’s a guide to making a plugin with a working UI. I can’t find too much on DevHub and videos on Youtube are too complicated for me. Is there an easier guide for that? Thanks!

Example:
image

1 Like

a plugin with visible and working frames, buttons etc.

I set it to the size of the gui. Unfortunately, I couldn’t find anything on DevHub and I followed every step on youtube videos. That’s why I’m looking for a different guide or something different.

This happened (it’s working), but how would I do that without creating frames through scripts to make a GUI with working buttons etc.

Parent the GUI that you want for your plugin, (fully scripted) to a Script in ServerScriptService, then write this on the script:

local plugin-name = "YOUR-PLUGIN-NAME-HERE"
local Plugin = PluginManager():CreatePlugin()
local Toolbar = Plugin:CreateToolbar("TOOLBAR-NAME-HERE")
local gui = script["GUI-NAME-HERE"]
local core = game:GetService("CoreGui")

local button = Toolbar:CreateButton(rbxassetid://icon-id-here, plugin-name)
button.Click:Connect(function()
   if gui.Parent = core then
       gui.Parent = script
   else
       gui.Parent = core
end)

disclaimer: not tested

please DON’T use instance.new…
Use a plugin button to parent and unparent the GUI to coregui. Example:

local toolbar = plugin:CreateToolbar("Example")
local functionScriptButton = toolbar:CreateButton("Text1", "Text2", "rbxassetid://5428265778")

functionScriptButton.Click:Connect(function()
    if script:FindFirstChild("scriptUtilGui") then
    script.scriptUtilGui.Parent = game:WaitForChild("CoreGui")
else
    game.CoreGui:WaitForChild("scriptUtilGui").Parent = script
end
end)

Sorry for the terrible formatting, just paste this into your plugin script and select all then repaste for it to fix

2 Likes

That would be a pain to format every single GUI and have the scripts in one script…

1 Like

would the Gui under the script also be saved when the plugin is published?
i had no idea!

If you REALLY wanna use Instance.new, use this

1 Like

Yes, when you publish the plugin any contents in the script will also publish, similar to publishing ModuleScripts.

1 Like

thanks this make’s it much easier
Oh i was confused when it didn’t work
you have to select everything before publishing the plugin

It’s working! Thank you so much. One more question, how would I make a widget. I followed everything that was on DevHub and still can’t understand it lol

I have no idea lol
I’m very new to plugin making, this is the best I can do for ya!

1 Like

I believe that if you want to make a plugin into a widget, you have to use widget GUIs? I’m not positive though.