How to make a GUI for a plugin?

Hello!

So I’ve recently started learning how to create plugins. I am now creating a test plugin, however I don’t really know how would I make a GUI for that plugin. So basically when you click the plugin button in the topbar, a pre-made gui appears (in edit mode). Just like this:

I’ve been looking on DevForum for a while now, eventually found some solutions, however they all didn’t work. I’ve tries using this, but no success.

PluginButton.Click:Connect(function()
	if gui.Parent == core then
		gui.Parent = script
	else
		gui.Parent = core
	end
end)

And yes, I have a GUI object parented to the script. Here is my explorer:
image

If anything is unclear, please let me know! :happy2:

I think this should work:

PluginButton.Click:Connect(function()
	if gui.Enabled then
		gui.Enabled = false
	else
		gui.Enabled = true
	end
end)

Thanks, but I already solved it because I was saving the script as the plugin and not the folder. Anyways, thanks for trying to help.

1 Like