Advertisement
CheckeredSkateboard

Sliding Door Source Code

Aug 20th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local door1 = script.Parent:WaitForChild("Door1")
  3. local tweeningInformation = TweenInfo.new(
  4. 0.5,
  5. Enum.EasingStyle.Linear,
  6. Enum.EasingDirection.Out,
  7. 0,
  8. false,
  9. 0
  10. )
  11. local door1Open = {CFrame = CFrame.new(-4.23, 3.99, -8.56)}
  12. local door1Close = {CFrame = CFrame.new(-11.57, 3.99, -8.56)}
  13. local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
  14. local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
  15.  
  16. script.Parent.Detector1.Touched:Connect(function(hit)
  17. tween1open:Play()
  18. wait(2)
  19. tween1close:Play()
  20. end)
  21. script.Parent.Detector2.Touched:Connect(function(hit)
  22. tween1open:Play()
  23. wait(2)
  24. tween1close:Play()
  25. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement