I’m creating a UI based plugin, and I’m having some trouble working out how to store the assets that I need to use in the plugin.
For example, the main ScreenGUI element.
At the moment for testing purposes, I’ve just added the ScreenGui to ReplicatedStorage and that’s how I am referencing it in the script (which is a plugin)
local GUI = game.ReplicatedStorage.ScreenGui:Clone()
GUI.Parent = game.CoreGui
GUI.Enabled = false
When I tried to parent the GUI to the script, I got the error “GUI not a child of Script”. Understandable, the plugin script is stored locally not in game.
How can I store this GUI without the player being able to see it? Is creating it using code the easiest option?
Would InsertService be a good solution?
Just a tip, when making GUI stuff for plugins it quickly gets annoying to constantly move the assets between the plugin and StarterGui so you can see what you’re doing. So I usually look for them in the script AND StarterGui, like this:
local pluginGui = pluginScript:FindFirstChild("TheGui") or game:GetService("StarterGui"):FindFirstChild("TheGui")