Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Not explained command:
- local tryMax, try, pWord = 3, 0, "*"
- local cmdPass, Pass = "Command","OpenDoor"
- function CheckPass()
- print("Enter Password: ("..try.."/"..tryMax.."):")
- local sel = read(pWord)
- if sel == cmdPass then
- shell.run('clear')
- print("Command Access Granted!")
- sleep(1.5)
- shell.run('clear')
- elseif sel == Pass then
- shell.run('clear')
- print("Access Granted!")
- sleep(1)
- shell.run('clear')
- redstone.setOutput("left", true)
- local openTime = 5
- for i=openTime, 1, -1 do
- print("Closing in "..i.." seconds")
- sleep(1)
- shell.run('clear')
- end
- redstone.setOutput("left", false)
- os.shutdown()
- else
- shell.run('clear')
- if try < tryMax then
- try = try + 1
- print("Wrong password!")
- sleep(1)
- CheckPass()
- return nil
- else
- print("Wrong password. Closing computer...") -- I don't make a LOCK...
- wait(1.5)
- shell.run('clear')
- shell.run('shutdown')
- return nil
- end
- end
- end
- CheckPass()
Advertisement
Add Comment
Please, Sign In to add comment