Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Door = script.Parent.Parent.Parent.Door
- local InputLabel = script.Parent.Parent.Screen.SurfaceGui.TextLabel
- local EnterButton = script.Parent.Parent.EnterButton
- local ClearButton = script.Parent.Parent.ClearButton
- local CorrectCode = "1234" --Change To Code
- local Input = ""
- function EnterCode()
- if Input == CorrectCode then
- print("Entered Correct Code")
- InputLabel.Text = "Correct Code"
- Door.Transparency = 1
- Door.CanCollide = false
- wait(5)
- Door.Transparency = 0
- Door.CanCollide = true
- return end
- print("Incorrect Code")
- Input = ""
- InputLabel.Text = "Incorrect Code"
- end
- EnterButton.ClickDetector.MouseClick:Connect(EnterCode)
- function ClearCode()
- print("Cleared Code")
- Input = ""
- InputLabel.Text = ""
- end
- ClearButton.ClickDetector.MouseClick:Connect(ClearCode)
- function Key1()
- print("1")
- Input = Input..1
- InputLabel.Text = Input
- end
- script.Parent.Key1.ClickDetector.MouseClick:Connect(Key1)
- function Key2()
- print("2")
- Input = Input..2
- InputLabel.Text = Input
- end
- script.Parent.Key2.ClickDetector.MouseClick:Connect(Key2)
- function Key3()
- print("3")
- Input = Input..3
- InputLabel.Text = Input
- end
- script.Parent.Key3.ClickDetector.MouseClick:Connect(Key3)
- function Key4()
- print("4")
- Input = Input..4
- InputLabel.Text = Input
- end
- script.Parent.Key4.ClickDetector.MouseClick:Connect(Key4)
- function Key5()
- print("5")
- Input = Input..5
- InputLabel.Text = Input
- end
- script.Parent.Key5.ClickDetector.MouseClick:Connect(Key5)
- function Key6()
- print("6")
- Input = Input..6
- InputLabel.Text = Input
- end
- script.Parent.Key6.ClickDetector.MouseClick:Connect(Key6)
- function Key7()
- print("7")
- Input = Input..7
- InputLabel.Text = Input
- end
- script.Parent.Key7.ClickDetector.MouseClick:Connect(Key7)
- function Key8()
- print("8")
- Input = Input..8
- InputLabel.Text = Input
- end
- script.Parent.Key8.ClickDetector.MouseClick:Connect(Key8)
- function Key9()
- print("9")
- Input = Input..9
- InputLabel.Text = Input
- end
- script.Parent.Key9.ClickDetector.MouseClick:Connect(Key9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement