So basically I have a gui but I want to tween all its transparency all at the same time but I don’t want to tween each frame with a script I want all off them to tween < pretty hard to understand
Ok how many guis do you have??
Its one basically i want to tween all frames and textlabels
Loop through the descendants of the frame and play a tween for all of them, use the IsA()
function to check the instance type.
local TweenService = game:GetService("TweenService")
for _, gui in pairs(playerGui:GetDescendants()) do -- Change playerGui
if not gui:IsA("TextLabel") or not gui:IsA("Frame") then continue end -- Add more checks | This is a better way as you might have scripts, screenGui, values and other things you may not want changed
local tweenInfo = TweenInfo.new(
2, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
TweenService:Create(gui, tweenInfo,{
Transparancy = 1
}):Play()
end
Hopefully this helps!
More on TweenService
1 Like