Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Set password
- local password = "1234"
- local doorSide = "right" -- Replace with the side your door is connected to
- -- Main program
- while true do
- -- Prompt for password
- io.write("Enter password: ")
- local input = io.read()
- -- Check if password is correct
- if input == password then
- print("Password correct, unlocking door.")
- redstone.setOutput(doorSide, true)
- sleep(5) -- Keeps the door open for 5 seconds, adjust as needed
- redstone.setOutput(doorSide, false)
- break
- else
- print("Password incorrect, locking door.")
- redstone.setOutput(doorSide, false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement