Advertisement
MandB

Code Door

Aug 14th, 2021
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. local Door = script.Parent.Parent.Parent.Door
  2. local InputLabel = script.Parent.Parent.Screen.SurfaceGui.TextLabel
  3. local EnterButton = script.Parent.Parent.EnterButton
  4. local ClearButton = script.Parent.Parent.ClearButton
  5.  
  6. local CorrectCode = "1234" --Change To Code
  7. local Input = ""
  8.  
  9. function EnterCode()
  10. if Input == CorrectCode then
  11. print("Entered Correct Code")
  12. InputLabel.Text = "Correct Code"
  13. Door.Transparency = 1
  14. Door.CanCollide = false
  15. wait(5)
  16. Door.Transparency = 0
  17. Door.CanCollide = true
  18. return end
  19. print("Incorrect Code")
  20. Input = ""
  21. InputLabel.Text = "Incorrect Code"
  22. end
  23. EnterButton.ClickDetector.MouseClick:Connect(EnterCode)
  24.  
  25. function ClearCode()
  26. print("Cleared Code")
  27. Input = ""
  28. InputLabel.Text = ""
  29. end
  30. ClearButton.ClickDetector.MouseClick:Connect(ClearCode)
  31.  
  32. function Key1()
  33. print("1")
  34. Input = Input..1
  35. InputLabel.Text = Input
  36. end
  37. script.Parent.Key1.ClickDetector.MouseClick:Connect(Key1)
  38.  
  39.  
  40. function Key2()
  41. print("2")
  42. Input = Input..2
  43. InputLabel.Text = Input
  44. end
  45. script.Parent.Key2.ClickDetector.MouseClick:Connect(Key2)
  46.  
  47.  
  48. function Key3()
  49. print("3")
  50. Input = Input..3
  51. InputLabel.Text = Input
  52. end
  53. script.Parent.Key3.ClickDetector.MouseClick:Connect(Key3)
  54.  
  55.  
  56. function Key4()
  57. print("4")
  58. Input = Input..4
  59. InputLabel.Text = Input
  60. end
  61. script.Parent.Key4.ClickDetector.MouseClick:Connect(Key4)
  62.  
  63.  
  64. function Key5()
  65. print("5")
  66. Input = Input..5
  67. InputLabel.Text = Input
  68. end
  69. script.Parent.Key5.ClickDetector.MouseClick:Connect(Key5)
  70.  
  71.  
  72. function Key6()
  73. print("6")
  74. Input = Input..6
  75. InputLabel.Text = Input
  76. end
  77. script.Parent.Key6.ClickDetector.MouseClick:Connect(Key6)
  78.  
  79.  
  80. function Key7()
  81. print("7")
  82. Input = Input..7
  83. InputLabel.Text = Input
  84. end
  85. script.Parent.Key7.ClickDetector.MouseClick:Connect(Key7)
  86.  
  87.  
  88. function Key8()
  89. print("8")
  90. Input = Input..8
  91. InputLabel.Text = Input
  92. end
  93. script.Parent.Key8.ClickDetector.MouseClick:Connect(Key8)
  94.  
  95.  
  96. function Key9()
  97. print("9")
  98. Input = Input..9
  99. InputLabel.Text = Input
  100. end
  101. script.Parent.Key9.ClickDetector.MouseClick:Connect(Key9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement