Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pw = "1234" -- password
- local time = 3.5 -- seconds the redstone output stays activated (right password)
- local fime = 2 -- seconds you get if you enter wrong password
- local side = "right" -- side of redstone output
- -- THE PROGRAM
- rs.setOutput(side, false)
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- write("Password: ")
- t = read("*")
- if t == pw then
- print("Right password. You have " .. time .. " seconds.")
- rs.setOutput(side, true)
- sleep(time)
- rs.setOutput(side, false)
- else
- rs.setOutput(side, false)
- print("Wrong password.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement