The reason why this doesn’t work is that they’re playing at the same time and ending at the same time, so you only need to wait for one to finish.
local function tweenClose()
if leftGateTweenConnection and rightGateTweenConnection then
leftGateTweenConnection:Pause()
rightGateTweenConnection:Pause()
leftGateTweenConnection = nil
rightGateTweenConnection = nil
end
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
leftGateTweenConnection = TweenService:Create(LeftGate, tweenInfo, {Position = UDim2.new(0, 0, 0, 0)})
leftGateTweenConnection:Play()
rightGateTweenConnection = TweenService:Create(RightGate, tweenInfo, {Position = UDim2.new(0.5, 0, 0, 0)})
rightGateTweenConnection:Play()
leftGateTweenConnection.Completed:Wait()
print("close complete")
return true
end
What’s happening is that since they’re both playing at the same time, both ends, the first .Completed:Wait() finishes but the other one also finished. Waiting on one is sufficient enough since they’re ending at roughly the same time.