Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. --<tkcmdr>--
  2.  
  3. local door = script.Parent
  4. local bool = true
  5. local bool2 = true
  6. local clearance = {
  7. ["Command"] = true,
  8. ["Alpha"] = true,
  9. ["Beta"] = true,
  10. ["Charlie"] = true,
  11. ["Delta"] = true,
  12. ["Echo"] = true,
  13. ["Fox"] = true,
  14. ["Golf"] = false,
  15. ["T-Card"] = false
  16. }
  17.  
  18. function openDoor()
  19. script.Parent.DoorOpen:play()
  20. for i = 1,(door.Size.z / 0.30) do
  21. door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.55)
  22. wait()
  23. end
  24. door.Transparency = 1
  25. for i,v in pairs(door:GetChildren()) do
  26. if v:IsA("Decal") then
  27. v.Transparency = 1
  28. end
  29. end
  30. wait(3)
  31. door.Transparency = 0
  32. for i,v in pairs(door:GetChildren()) do
  33. if v:IsA("Decal") then
  34. v.Transparency = 0
  35. end
  36. end
  37. script.Parent.DoorClose:play()
  38. for i = 1,(door.Size.z / 0.30) do
  39. wait()
  40. door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.55)
  41. end
  42. end
  43.  
  44. script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
  45. if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
  46. bool = false
  47. script.Parent.AccessGranted:play()
  48. script.Parent.Parent.Light1.brickColor = BrickColor.new("Lime green")
  49. script.Parent.Parent.Light2.brickColor = BrickColor.new("Lime green")
  50. script.Parent.Parent.Light3.brickColor = BrickColor.new("Lime green")
  51. script.Parent.Parent.Light4.brickColor = BrickColor.new("Lime green")
  52. script.Parent.Parent.Light5.brickColor = BrickColor.new("Lime green")
  53. script.Parent.Parent.Light6.brickColor = BrickColor.new("Lime green")
  54. script.Parent.Parent.Light7.brickColor = BrickColor.new("Lime green")
  55. openDoor()
  56. wait(1)
  57. script.Parent.Parent.Light1.brickColor = BrickColor.new("Lily white")
  58. script.Parent.Parent.Light2.brickColor = BrickColor.new("Lily white")
  59. script.Parent.Parent.Light3.brickColor = BrickColor.new("Lily white")
  60. script.Parent.Parent.Light4.brickColor = BrickColor.new("Lily white")
  61. script.Parent.Parent.Light5.brickColor = BrickColor.new("Lily white")
  62. script.Parent.Parent.Light6.brickColor = BrickColor.new("Lily white")
  63. script.Parent.Parent.Light7.brickColor = BrickColor.new("Lily white")
  64. bool = true
  65. elseif touch.Name == "Handle" and not clearance[touch.Parent.Name] and bool2 then
  66. bool2 = false
  67. script.Parent.AccessDenied:play()
  68. wait(1)
  69. bool2 = true
  70. end
  71. end)
  72.  
  73. script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
  74. if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
  75. bool = false
  76. script.Parent.AccessGranted:play()
  77. script.Parent.Parent.Light1.brickColor = BrickColor.new("Lime green")
  78. script.Parent.Parent.Light2.brickColor = BrickColor.new("Lime green")
  79. script.Parent.Parent.Light3.brickColor = BrickColor.new("Lime green")
  80. script.Parent.Parent.Light4.brickColor = BrickColor.new("Lime green")
  81. script.Parent.Parent.Light5.brickColor = BrickColor.new("Lime green")
  82. script.Parent.Parent.Light6.brickColor = BrickColor.new("Lime green")
  83. script.Parent.Parent.Light7.brickColor = BrickColor.new("Lime green")
  84. openDoor()
  85. wait(1)
  86. script.Parent.Parent.Light1.brickColor = BrickColor.new("Lily white")
  87. script.Parent.Parent.Light2.brickColor = BrickColor.new("Lily white")
  88. script.Parent.Parent.Light3.brickColor = BrickColor.new("Lily white")
  89. script.Parent.Parent.Light4.brickColor = BrickColor.new("Lily white")
  90. script.Parent.Parent.Light5.brickColor = BrickColor.new("Lily white")
  91. script.Parent.Parent.Light6.brickColor = BrickColor.new("Lily white")
  92. script.Parent.Parent.Light7.brickColor = BrickColor.new("Lily white")
  93. bool = true
  94. elseif touch.Name == "Handle" and not clearance[touch.Parent.Name] and bool2 then
  95. bool2 = false
  96. script.Parent.AccessDenied:play()
  97. wait(1)
  98. bool2 = true
  99. end
  100. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement