Onscreen Rain Script

Hey guys so my code for constant rain on the screen doesn’t work and it’s because my tween is playing but they are playing at the same time, how do I make them play after each other??

local TweenService = game:GetService("TweenService")
local CurrentPosition = script.Parent.Position
local tweenInfo1 = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local TweenOpen = TweenService:Create(script.Parent, tweenInfo1, {Position = UDim2.new(0.5, 0, 2, 0 )})
local TweenOpen2 = TweenService:Create(script.Parent.Parent.Imagelabel2, tweenInfo1, {Position = UDim2.new(0.5, 0, 2, 0 )})
while true do
    TweenOpen:Play()
    wait(0.19)
    script.Parent.Parent.Imagelabel2.Position = UDim2.new(0.5, 0, -1, 0)
    TweenOpen2:Play()
    script.Parent.Position = UDim2.new(0.5, 0, -1, 0)
end
1 Like

Do this:

TweenOpen.Completed:Wait()

Just tried that in this code

local TweenService = game:GetService("TweenService")

local CurrentPosition = script.Parent.Position

local tweenInfo1 = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)

local TweenOpen = TweenService:Create(script.Parent, tweenInfo1, {Position = UDim2.new(0.5, 0, 2, 0 )})

local TweenOpen2 = TweenService:Create(script.Parent.Parent.Imagelabel2, tweenInfo1, {Position = UDim2.new(0.5, 0, 2, 0 )})

while true do

TweenOpen:Play()

print("tweenOpen played")

TweenOpen.Completed:Wait()

print("waited 0.19")

script.Parent.Parent.Imagelabel2.Position = UDim2.new(0.5, 0, -1, 0)

print("changing p**osition of ImageLabel2")

TweenOpen2:Play()

print("TweenOpen2 has been played")

script.Parent.Position = UDim2.new(0.5, 0, -1, 0)

print("Parents position has changed")

end

So? What was the outcome? Any errors?

No none, they still pause before each of them start, want a copy?

Seemed to get it fixed by just firing each image half way into the last one!