I want to put a UI into a plugin, but it doesn’t work.
When I save my plugin as a local plugin, it doesn’t have UIs in the plugin.
I have already tried looking it up on the dev hub, but found no helpful topics. I have also tried to make a new frame with Instance.new instead of re parenting a ScreenGui, but it still hasn’t worked.
Heres the code:
local widgetinfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
true,
true,
246,
227
)
local widget = plugin:CreateDockWidgetPluginGui(“UIHelper”, widgetinfo)
local screengui = Instance.new(“ScreenGui”)
screengui.Parent = widget
script.ScreenGui.TextButton.MouseButton1Click:Connect(function()
local selection = game:GetService(“Selection”)
if selection[1] then
for i,v in pairs(selection) do
if v:IsA(“Frame”) or v:IsA(“TextLabel”) or v:IsA(“TextButton”) then
local newframe = Instance.new(“ImageLabel”)
newframe.Position = UDim2.new(v.Position)
newframe.Size = UDim2.new(v.Size)
newframe.ImageColor3 = Color3.new(v.BackgroundColor3)
newframe.AnchorPoint = Vector2.new(v.AnchorPoint)
newframe.Parent = v.Parent
newframe.Image = ‘http://www.roblox.com/asset/?id=5590730321’
v:Destroy()
end
end
end
end)
The error is on line 13.