Help With GUI Plugin

So uh, I’m new to coding plugins and I really need some help. I’m having issues parenting a GUI to a widget. The script can’t seem to find any objects that are a child of it. Any replies would be appreciated.
Screenshot_318

Screenshot_319

Code:

local UI = script:WaitForChild("UI")

local toolbar = plugin:CreateToolbar("Script Creator")
local button = toolbar:CreateButton(
	"Script Creator", -- ID
	
	"Script Creator", -- Tooltip
	
	"" -- Image
)

local widget = plugin:CreateDockWidgetPluginGui(
	"Script Creator",
	
	DockWidgetPluginGuiInfo.new(
		Enum.InitialDockState.Float,
		false,
		true,
		150,
		150,
		100,
		100
	)
)
widget.Title = "Script Creator"

UI.Parent = widget

button.Click:Connect(function()
	widget.Enabled = true
end)

This script is named “ScriptCreator”??

Yes, but the name of the script shouldn’t have any effect.

If you want to fix this problem, you will have to put your script in a folder, and save that folder as a plugin instead of the script itself

Normally, it’s better to make plugins with a Server Script. And also, in your image of the Explorer, what’s the parent of the Local Script? Also @rokoblox5 is correct, you need to make a Model or Folder and then save that as a Local Plugin