Answered by
5 years ago Edited 5 years ago
If you want the part to go back after a certain timeout, you will need to split tween to 2 separate tweens:
01 | local Part 1 , Part 2 = script.Parent.PartA, script.Parent.PartB; |
06 | local tweenInfo = TweenInfo.new( |
09 | Enum.EasingStyle.Linear |
14 | local aStartingPosition = Part 1. Position |
15 | local bStartingPosition = Part 2. Position |
16 | local a = TweenService:Create(Part 1 , tweenInfo, { Position = Vector 3. new( 81 , 5 , 197 ) } ) |
17 | local aReverse = TweenService:Create(Part 1 , tweenInfo, { Position = aStartingPosition } ) |
18 | local b = TweenService:Create(Part 2 , tweenInfo, { Position = Vector 3. new( 99 , 5 , 203 ) } ) |
19 | local bReverse = TweenService:Create(Part 2 , tweenInfo, { Position = bStartingPosition } ) |
26 | wait(tweenTime + cooldown) |
31 | wait(tweenTime + cooldown) |
Just remeber that playing a tween does not yield the thread, so you need to add tween time to cooldown time, before playing reverse tween.