Let’s say I have module A which inside of it has:
local gui = game.Players.LocalPlayer.MainGui
local frame = gui.Frame
frame.Visible = true
And then module B which inside of it has:
local gui = game.Players.LocalPlayer.MainGui
local frame = gui.Frame
frame.Visible = false
You can see the first two lines are repetitive, this is the case in many of my UI modules which gets some services and then variables such as PlayerGui.
Would it be better if in a different module I just have all the UI variables and services and then I call that module in module A and module B?
Any help is appreciated, thanks.