So, I’ve been wanting to learn on how to create a plugin because I’ve been working on one currently. I used a couple of YouTube tutorials but I didn’t get the expected results. I also didn’t get any errors. Here’s my code:
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local tb = plugin:CreateToolbar("Custom Building Parts")
local newbutton = tb:CreateButton("Custom Building Part Options", "Custom Building Parts", "rbxassetid://7017384160")
local opened = false
local NW = plugin:CreateDockWidgetPluginGui(
"Custom Building Part Options",
DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
true,
true,
200,
44,
200,
44
)
)
script:WaitForChild("PluginGui"):Clone().Parent = NW
Adding on, here’s my problematic results in words:
In words it basically shows up a gui but it’s blank.
The spelling is correct but that’s not my problem (although it isn’t actually loading the icon). The problem is that it basically shows up a gui but it’s blank.
Well your going to need a ScreenGUI in the code. And make sure the properties are set right, in the ScreenGUI
Example:
It doesn’t always have to be in Workspace, too. Also, triple check the code. I am not good at plugin type coding, but I think this might be the problem.
Meaning: Infinite yield possible on is a warning in Roblox Studio that means there is a possibility that your script could be stuck on that line waiting forever if object it is waiting on doesn’t exist and is never created.
So there may be something there putting it into a forever loop!
That depends on code in the Gui. Try and look at the code there. If there is none, then you might need it for it to have a “link” as I call it. It may still reference it, but what is in the code there?
Your plugin is working correctly, however you haven’t added any GUI elements to change the appearance of it. Please at least try to make a GUI for the plugin before asking questions like this.
That’s expected since you need to replace the WaitForChild with something like this
NW.Title = "plugin name here"
NW.Name = "plugin name here"
local MaxSize = 12
local MinSize = 6
local ThicknessSize = 0
local IsBorder = false
local AutoAdjustZIndex = true
local GlobalZindex = true
newbutton.Click:Connect(function()
NW.Enabled = not NW.Enabled
end)
local BaseGui = script.Parent.PluginGui
BaseGui.Parent = NW
I’m on my phone so I can’t guarantee that this’ll work however I’m looking through one of my plugins source code and this should work
Make sure the PluginGui is a Frame and it won’t work unless you move it up into YourPluginsFolder.PluginGui and not YourPluginsFolder.Script.PluginGui