I have a moving part that is basically an elevator
local part = script.Parent
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
600, --Duration in seconds
Enum.EasingStyle.Linear, --EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime in seconds
)
local tweenGoal = {Position = part.Position + Vector3.new(0,-1000,0)}
local tween = tweenService:Create(part,tweenInfo,tweenGoal)
tween:Play()
this makes the part go down for 30 floors, i want it so when it hits the final position, it waits for 30 seconds and the part goes up.
local part = script.Parent
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
600, --Duration in seconds
Enum.EasingStyle.Linear, --EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
30 -- DelayTime in seconds
)
local tweenGoal = {Position = part.Position + Vector3.new(0,-1000,0)}
local tween = tweenService:Create(part,tweenInfo,tweenGoal)
tween:Play()
It should be exactly this.
local part = script.Parent
local tweenService = game:GetService("TweenService")
local tweenInfoDown = TweenInfo.new(
600, --Duration in seconds
Enum.EasingStyle.Linear, --EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime in seconds
)
local tweenInfoUp = TweenInfo.new(
60 , --Duration in seconds
Enum.EasingStyle.Linear, --EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime in seconds
)
local tweenGoalDown = {Position = part.Position + Vector3.new(0,-1000,0)}
local tweenGoalUp = {Position = part.Position + Vector3.new(0,1000,0)}
local tweenDown = tweenService:Create(part,tweenInfoDown,tweenGoalDown)
local tweenUp = tweenService:Create(part,tweenInfoUp,tweenGoalUp)
tweenDown:Play()
tweenDown.Completed:Connect(function()wait(30)tweenUp:Play()end)
tweenUp.Completed:Connect(function()wait(30)tweenDown:Play()end)
Tell me if this worked, I basically made another tween for it going up and made it play when its done going down, then when its done going up, it goes down again.