How can I make plugin Gui?

Hey, I was wondering How would I make a gui for a plugin.
I don’t wanna create them in the script Can I make them in-studio?
if so how? I tried making the gui parented to the script then cloning the gui to the starter gui but, for some reason it isn’t a valid member of the script.

I also saw other topics about this but, it didn’t work. any help is appreciated.

local ToolBar = plugin:CreateToolbar("Ez Leaderstats")
local ToolBarButton = ToolBar:CreateButton("Insert Leaderstats", "Instert a Leaderstats", "rbxassetid://4458901886")

local LeaderstatsInserted = false

ToolBarButton.ClickableWhenViewportHidden = true

local EzLeaderstatsGuiClone = script.EzLeaderstatsGui


ToolBarButton.Click:Connect(function()


	local MainFrame = EzLeaderstatsGuiClone.MainFrame
	EzLeaderstatsGuiClone.Parent = game.StarterGui


	MainFrame.CreateButton.MouseButton1Click:Connect(function()
		
	end)
end)

Does anyone know why?
Please help if so.

You could just make UI normally how you do for games, and just clone it to Core Gui.

1 Like

That’s not the problem, I tried to use the clone system but it says the Gui isn’t a valid member of the script.

That’s right. I figured out this problem myself too a few days ago. When you save the plugin file, it only saves the script that you’re saving, not the objects within it. So, you could set the Gui’s parent to ReplicatedStorage or something like that, and make a variable of it. And when you publish the main plugin you could set the gui’s parent to the main plugin script, and change all the variable paths.

1 Like

u could use CreateDockWidgetPluginGui
example down below

local Toolbar = plugin:CreateToolbar("EZ Leaderboards")
local LeaderboardButton = Toolbar:CreateButton("Leaderboard", "Instert a Leaderstats", "rbxassetid://649211310", "Leaderboard")
local Opened = false

local LeaderboardWidgetInfo = DockWidgetPluginGuiInfo.new(
    Enum.InitialDockState.Left,
    false,
    false, 
    200,
    300,
    150,
    150
)

local LeaderboardWidget = plugin:CreateDockWidgetPluginGui("Leaderboard", LeaderboardWidgetInfo)
LeaderboardWidget.Title = "Leaderboard"
local LeaderboardGui = script.Parent.LeaderboardGui
LeaderboardGui.Parent = LeaderboardWidget





LeaderboardButton.Click:Connect(function()
    if Opened then
        LeaderboardWidget.Enabled = false
        Opened = false
    else
        LeaderboardWidget.Enabled = true
        Opened = true
    end
end)
1 Like

or you could just get the frame parent to the folder it should fix the problem