Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tweenservice = game:GetService("TweenService")
- local doorleft = script.Parent:WaitForChild("DoorLeft")
- local doorright = script.Parent:WaitForChild("DoorRight")
- local function tween(target,direction,style,seconds,position)
- local tween = tweenservice:Create(target,TweenInfo.new(seconds,style,direction),{Position = position})
- tween:Play()
- end
- while true do
- wait(5) -- duration of how long the door will stay closed
- tween(doorleft,Enum.EasingDirection.Out,Enum.EasingStyle.Bounce,1,doorleft.Position + Vector3.new(-3.4,0))
- tween(doorright,Enum.EasingDirection.Out,Enum.EasingStyle.Bounce,1,doorright.Position + Vector3.new(3.4,0))
- wait(1) --wait for the door animation to finish first
- wait(2) --duration of how long the door will stay open
- tween(doorleft,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,1,doorleft.Position - Vector3.new(-3.4,0))
- tween(doorright,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,1,doorright.Position - Vector3.new(3.4,0))
- wait(1) -- wait for the door animation to finish first
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement