Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Password for the door
- local password = "1616"
- -- Function to open the door
- local function openDoor()
- redstone.setOutput("front", true)
- sleep(2)
- redstone.setOutput("front", false)
- end
- -- Main loop
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Enter password:")
- -- Read user input
- local input = read("*")
- -- Check if password is correct
- if input == password then
- print("Access granted!")
- openDoor()
- else
- print("Access denied!")
- end
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment