for i, child in pairs(script.Parent:GetChildren()) do
if child.ClassName == "ImageLabel" then
--create tween
local info = TweenInfo.new(SPEED, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1)
local introInfo = TweenInfo.new(SPEED, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local goal = {Position = UDim2.new(0, 0, 0, 0)}
local introGoal = {Position = UDim2.new(-1, 0, 0, 0)}
local tween = tweenServ:Create(child, info, goal)
local introTween = tweenServ:Create(child, introInfo, introGoal)
child:GetPropertyChangedSignal("Visible"):Connect(function()
if child.Visible then
child.Position = UDim2.new(-2, 0, 0, 0)
introTween:Play()
print("waiting")
introTween.Completed:Wait()
print("ready")
tween:Play()
print("done")
else
tween:Pause()
end
end)
end
end
I have this rigged up so that every time a different script makes this banner visible, it will start an animation.
However, it doesn’t loop properly. I want it to come in from the left, and then play a new tween going to the right, and looping that repeatedly so it looks like an endless loop, almost like an endless “stream” but from the left side of the screen.
It works the first time, but never again. The print statements print as well. It gets right up to the tween statement, and even prints the line after it.
Why isn’t it playing?