I am trying to write a script where the tweeninfo will get all the children of a Frame and tween the TextLabel’s transparency to give it a fade in and out effect. For some reason, the script runs, but it only tweens the first TextLabel within the frame.
local LoadingTime = script.Parent
local LoadingTimeChildren = LoadingTime:GetChildren()
local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
LoadingTime.Visible = true
for numberof, textlable in pairs(LoadingTimeChildren) do
if textlable:IsA("TextLabel") then
local LoadingTimeTween = tweenservice:Create(LoadingTime.TextLabel, tweeninfo, {TextTransparency = 1})
LoadingTimeTween:Play()
end
end
You have the first argument of tweenesrvice:Create() as LoadingTime.TextLabel. It will randomly pick one and tween that same one every time. You want to use the textlabel that is given in the for loop.