Plugin script returning error

I am developing a plugin that shows UI on the screen when opened, but the UI isn’t showing up.

local toolbar = plugin:CreateToolbar("Update")
local functionScriptButton = toolbar:CreateButton("Launch Updater", "", "rbxassetid://15110885598")

functionScriptButton.Click:Connect(function()
	if script:FindFirstChild("UpdaterUI") then
		script.UpdaterUI.Parent = game:GetService("CoreGui")
	else
		game.CoreGui:FindFirstChild("UpdaterUI").Parent = script
	end
end)

When I try to open the plugin, it returns the error user_UpdatePlugin.lua.Script:8: attempt to index nil with ‘Parent’
How can I fix this and get the plugin to open?

Try:

script.UpdaterUI.Parent = script

“attempt to index nil with ‘parent’”
the thing you tried to parent isnt there.

game.CoreGui is not a thing

How would I make it a thing? I tried using game:GetService(“CoreGui”)

Are you trying to get the players GUI? the frames or core guis

I’m trying to move UpdaterUI into the CoreGUI when the plugin is opened

I don’t know what you mean.
if you’re speaking about the players guis then its game:getservice(“STARTERGUI”) not coregui

if you want it in of the players coregui i don’t know how its possible

It’s a script for a Studio plugin that runs in the Studio editor. I made one in the past, but unfortunately lost the files and how to make it, and it needs to be interacted with in the Studio editor, so startergui and playergui won’t work.