It’s alright I guess,
There are a few bad practices that I want to address.
First, using instance.new to set the parent is not too great for performance.
Set the parent last
local thing = Instance.new("Part")
-- modify properties
thing.Parent = workspace
Second, everything to do with variables.
-
Variable names are wonky. You have variable names like “Sure” to save tweenInfo, it would be much better suited with a variable like “frameTweenInfo”
-
Creating variables when you don’t need to.
local Hedef = {}
Hedef.TextTransparency = 0
local Sure = TweenInfo.new(0.5)
local Tween = TweenService:Create(Game_Name_Text, Sure, Hedef)
Tween:Play()
-- Can be condensed down to
local tweenInfo = TweenInfo.new(.5)
TweenService:Create(Game_Name_Text, tweenInfo, {TextTransparency = 0}):Play()
Also you create new TweenInfo’s instead of reusing the ones you have already created.
It’s just adding more clutter to your code!
Third, creating all of this UI is supper inefficient compared to just having a UI in replicated storage and cloning it. Then you can use TweenService on those parts.
If you need to hide elements of the UI, you can simply use Visible property of GUI elements to keep them hidden.
Fourth, when creating UI, make sure to make use of Anchor Point
It will prevent you from creating messy UDim2 values like these.
Game_Name_Text.Position = UDim2.new(0.266, 0, 0.104, 0)
Game_Name_Text.Size = UDim2.new(0.468, 0, 0.232, 0)
Finally, regarding module scripts. No need for a variable, when you can return the function directly
-- Somewhat what your module looks like
local module = {}
function module.action(Player)
end
return module
--------
-- different method
return function(player)
end
You can call it like this
local intro = require(pathToModuleScript)
intro(game.Players.LocalPlayer)