Advertisement
Guest User

thing

a guest
Jun 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. --<tkcmdr>--
  2.  
  3. --"False" = Not Acceptable Keycard To Open. "True" = Acceptable Keycard To Open.--
  4.  
  5. local bool = true
  6. local bool2 = true
  7. local clearance = {
  8. ["[SCP] Card-Omni"] = true,
  9. ["[SCP] Card-L5"] = true,
  10. ["[SCP] Card-L4"] = true,
  11. ["[SCP] Card-L3"] = true,
  12. ["[SCP] Card-L2"] = true,
  13. ["[SCP] Card-L1"] = true,
  14. ["[SCP] Card-L0"] = false
  15. }
  16.  
  17. --DO NOT EDIT BEYOND THIS LINE--
  18. local LeftDoor = script.Parent
  19. local RightDoor = script.Parent.Parent.RightDoor
  20. local Open = false
  21.  
  22. local OpenSound = script.Parent.DoorOpen
  23. local CloseSound = script.Parent.DoorClose
  24.  
  25. local Debounce = false
  26. function openDoor()
  27. if not Debounce then
  28. Debounce = true
  29. if Open then
  30. Open = false
  31. CloseSound:Play()
  32. Spawn(function()
  33. for i = 1, 50 do
  34. LeftDoor.CFrame = LeftDoor.CFrame + (LeftDoor.CFrame.lookVector * 0.1)
  35. wait(0.05)
  36. end
  37. end)
  38. Spawn(function()
  39. for i = 1, 50 do
  40. RightDoor.CFrame = RightDoor.CFrame + (RightDoor.CFrame.lookVector * 0.1)
  41. wait(0.05)
  42. end
  43. end)
  44. else
  45. Open = true
  46. OpenSound:Play()
  47. Spawn(function()
  48. for i = 1, 50 do
  49. LeftDoor.CFrame = LeftDoor.CFrame - (LeftDoor.CFrame.lookVector * 0.1)
  50. wait(0.05)
  51. end
  52. end)
  53. Spawn(function()
  54. for i = 1, 50 do
  55. RightDoor.CFrame = RightDoor.CFrame - (RightDoor.CFrame.lookVector * 0.1)
  56. wait(0.05)
  57. end
  58. end)
  59. end
  60. wait(2.5)
  61. Debounce = false
  62. end
  63. end
  64.  
  65. script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
  66. if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
  67. bool = false
  68. script.Parent.AccessGranted:play()
  69. wait(1)
  70. openDoor()
  71. wait(3)
  72. openDoor()
  73. wait(3)
  74. bool = true
  75. elseif touch.Name == "Handle" and not clearance[touch.Parent.Name] and bool2 then
  76. bool2 = false
  77. script.Parent.AccessDenied:play()
  78. wait(1)
  79. bool2 = true
  80. end
  81. end)
  82.  
  83. script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
  84. if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
  85. bool = false
  86. script.Parent.AccessGranted:play()
  87. wait(1)
  88. openDoor()
  89. wait(3)
  90. openDoor()
  91. wait(3)
  92. bool = true
  93. elseif touch.Name == "Handle" and not clearance[touch.Parent.Name] and bool2 then
  94. bool2 = false
  95. script.Parent.AccessDenied:play()
  96. wait(1)
  97. bool2 = true
  98. end
  99. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement