#Optimize code?
1 messages · Page 1 of 1 (latest)
LocalScript
local button_PLAY = script.Parent.Frame.PLAY_BUTTON
local menu_FRAME = script.Parent
local menu_FRAME_CONT = menu_FRAME.Frame
local tween_MOD = require(game.StarterPlayer.StarterPlayerScripts:WaitForChild('LOCAL_TWEEN'))
button_PLAY.MouseButton1Click:Connect(function()
local currentPos = menu_FRAME_CONT.Position
local tr_SETTING = {
TextTransparency = 1
}
local pos_TABLE = {
Position = UDim2.new(
currentPos.X.Scale -1,
currentPos.X.Offset,
currentPos.Y.Scale,
currentPos.Y.Offset
)
}
tween_MOD.GUItween(menu_FRAME_CONT, .75, 'Quad', 'In', 0, false, 0, tr_SETTING, true)
task.wait(.5)
tween_MOD.GUItween(menu_FRAME, 1, 'Quad', 'In', 0, false, 0, pos_TABLE, false)
end)
button_PLAY.MouseEnter:Connect(function()
end)```
Module Script
local LOCAL_TWEEN = {}
local tween_SERVICE = game:GetService('TweenService')
function LOCAL_TWEEN.GUItween(tg_DIR, t_time, tstyle, tdir, trep, trev, tdel, tgoal, cc)
local tween_INFO = TweenInfo.new(
t_time,
Enum.EasingStyle[tstyle],
Enum.EasingDirection[tdir],
trep,
trev,
tdel
)
if cc then
for _, m in ipairs(tg_DIR:GetChildren()) do
if m:IsA('GuiObject') then
local tween = tween_SERVICE:Create(m, tween_INFO, tgoal)
tween:Play()
end
end
else
local tween = tween_SERVICE:Create(tg_DIR, tween_INFO, tgoal)
tween:Play()
end
end
return LOCAL_TWEEN```
its fine
what style guide is this guy using😭