Hello, hope you are doing well
I have been trying to learn on how to make plugins to make my life easier (based off my other post), yet I encountered another issue.
I want to create a frame that pops up whenever I click the plugin button, yet it always errors whenever I try to publish the script as a local plugin and throws the error Main is not a valid member of Plugin "user_addborder.lua"
I have tried parenting the script to the screengui that I am using, parenting the screengui to the script, yet nothing worked.
Here is hat I have so far:
local selection = game:GetService('Selection')
local toolbar = plugin:CreateToolbar('Add Border Around Parts')
local pluginButton = toolbar:CreateButton(
'Add border',
'Button to add a border around a part',
'http://www.roblox.com/asset/?id=1557174355'
)
local info = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
false,
false,
500,
500,
100,
100
)
local widget = plugin:CreateDockWidgetPluginGui(
'Add Border',
info
)
widget.Title = 'Add a border around a part!'
script.Main.Main.Parent = widget
pluginButton.Click:Connect(function()
widget.Enabled = not widget.Enabled
end)
local add = script.Main.Main.Add
local amount = script.Main.Main.Amount
The main problem should be around here:
local widget = plugin:CreateDockWidgetPluginGui(
'Add Border',
info
)
widget.Title = 'Add a border around a part!'
script.Main.Main.Parent = widget
pluginButton.Click:Connect(function()
widget.Enabled = not widget.Enabled
end)
I would appreciate any help, thanks!