So, I've made a plugin that works fine. The GUI opens/closes. But the only problem I'm having is that the buttons in the GUI doesn't work.
Plugin script:
print("Part creator plugin loaded!") -- I was bored, so I decided to do something random
local toolbar = plugin:CreateToolbar("dragonmaster4111")
local button = toolbar:CreateButton(
"Create Part",
"Click anywhere to insert a part at your mouse position",
"rbxassetid://430069553"
)
function InsertGUI()
script.Parent.GUI:Clone().Parent = game.CoreGui
end
function RemoveGUI()
game.CoreGui:FindFirstChild("GUI"):Destroy()
end
button.Click:connect(function()
if not game.CoreGui:FindFirstChild("GUI") then
InsertGUI()
else
RemoveGUI()
end
end)
And, the script inside the button that doesn't work when you click it:
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Types.Visible ~= true then
script.Parent.Parent.Types.Visible = true
script.Parent.Rotation = 180
else
script.Parent.Types.Visible = false
script.Parent.Rotation = 0
end
end)
Note: This plugin has everything in a folder. The GUI is premade. The script clones it into CoreGui when you click the button in it's toolbar.

1 comment
Why a downvote? At least tell me what I need to change.