Advertisement
Guest User

Untitled

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