How do I clone a gui into player screen when clicked plugin

Hey, I made a gui, and I want it to make it visible when someone clicks the plugin
But there was an error saying gui is not a valid member of script

local toolbar = plugin:CreateToolbar("Font Picker")
local newbutton = toolbar:CreateButton("Font Chooser","Choose good fonts","rbxassetid://7932623079")
local selection = game:GetService("Selection")

newbutton.ClickableWhenViewportHidden = true
if script:FindFirstChild("ScreenGui") then
    print("Gui in script")
elseif game.CoreGui:FindFirstChild("ScreenGui") then
    print("Gui is in core gui")
else
    print("lol gui went missing")
end
-- it prints gui is missing

I saved it into a local plugin in my device, and it prints this

You are not creating a ScreenGui to put in the CoreGUI

What? What else you put in the Core Gui, I kept a screen gui

Well what does the script print?

lol gui went missing
It prints this

Try searching in StarterGui and not CoreGui

You arent creating a screengui in coregui.

I tried all of them, and I noticed the gui does not appear, and only the script saves

Wdym?

`game.StarterGui:FindFirstChild(“ScreenGui”)

i know im late, but the reason why this happens is because the GUI isn’t automatically added when you save the script locally. Instead, select the Script and the UI and right click “Save as local plugin”

image

Ok also thats what I did, only the script saves, the gui in it is missing/deleted/lost

Any clue?

you never add the UI anywhere. Would you mind sneding the .RBMX file?

Sure I will do it, give me a moment

Here
PluginGame.rbxl (39.4 KB)

So it prints gui is missing, its not in coregui/screen gui