local TweenService = game:GetService("TweenService")
TweenIt = function(Object, Changes, Time, Reversing, EasingStyle)
local Info = TweenInfo.new(
Time,
EasingStyle or Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- Times repeteated
Reversing or false, -- Reversing
0 -- Time Delay
)
local Action = TweenService:Create(Object, Info, Changes)
return Action
end
function AlterTransparency(Gui, Transparency)
for i, v in pairs(Gui:GetDescendants()) do
if v:IsA"ImageLabel" or v:IsA"ImageButton" then
TweenModule.TweenIt(v, {ImageTransparency = Transparency}, .5):Play()
elseif v:IsA"TextLabel" or v:IsA"TextButton" then
TweenModule.TweenIt(v, {TextTransparency = Transparency, TextStrokeTransparency = Transparency}, .5):Play()
end
end
end
Usage:
AlterTransparency(MyScreenGui, 1)
In Action:
I was working in something in which I made this so why not