SHARE
TWEET

Untitled

a guest Jan 28th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local TweenService = game:GetService("TweenService")
  2.  
  3. local Door1 = script.Parent.g1
  4.  
  5. local Door2 = script.Parent.g2
  6.  
  7. local cd = script.Parent.Part.ClickDetector
  8.  
  9. local D1Pos = script.Parent.oG1
  10.  
  11. local D2Pos = script.Parent.oG2
  12.  
  13. local Door1Open = {
  14.     CFrame = D1Pos.CFrame:ToWorldSpace(CFrame.new(0, 0, 0))
  15. }
  16.  
  17.  
  18. local Door2Open = {
  19.     CFrame = D2Pos.CFrame:ToWorldSpace(CFrame.new(0, 0, 0))
  20. }
  21.  
  22.  
  23. local Door1Closed = {
  24.     CFrame = Door1.CFrame:ToWorldSpace(CFrame.new(0, 0, 0))
  25. }
  26.  
  27.  
  28. local Door2Closed = {
  29.     CFrame = Door2.CFrame:ToWorldSpace(CFrame.new(0, 0, 0))
  30. }
  31.  
  32.  
  33. local Information = TweenInfo.new(
  34.     0.8,
  35.     Enum.EasingStyle.Quint,
  36.     Enum.EasingDirection.Out,
  37.     0,
  38.     false,
  39.     0
  40. )
  41.  
  42. local Door1Open = TweenService:Create(Door1, Information, Door1Open)
  43.  
  44. local Door2Open = TweenService:Create(Door2, Information, Door2Open)
  45.  
  46. local Door1Closed = TweenService:Create(Door1, Information, Door1Closed)
  47.  
  48. local Door2Closed = TweenService:Create(Door2, Information, Door2Closed)
  49.  
  50.  
  51. local db = false
  52.  
  53. cd.MouseClick:Connect(function()
  54.     if db == false then
  55.         db = true
  56.         Door1Open:Play()
  57.         Door2Open:Play()
  58.         wait(5)
  59.         Door1Closed:Play()
  60.         Door2Closed:Play()
  61.         wait(1)
  62.         db = false
  63.     end
  64. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top