Guest User

Untitled

a guest
May 18th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. -- Made by tylorddude123, do not copy under your name or take credit for my work!
  2.  
  3. print ("Welcome back!")
  4. print("Loading...")
  5. sleep(2)
  6. print("Hello!");
  7. sleep(2)
  8. debug="shutdown"
  9. correct="password"
  10. opentime = 5
  11. maxtries=5
  12. tries=0
  13. function lock()
  14. password()
  15. if user == debug then
  16.  print "Shutting down CraftOS"
  17.  shell.run("shutdown")
  18. end
  19. if user == correct then
  20.  print "Password correct, booting computer..."
  21.  correct()
  22. end
  23. if not(user == correct) or (user == debug) then
  24.  if tries == maxtries -1 then
  25.   if protectmode then
  26.    protect()
  27.     else
  28.    print "Too many tries"
  29.    print "Shutting down..."
  30.    sleep (2)
  31.    shell.run("shutdown")
  32.   end
  33.    else
  34.   print "Incorrect Password."
  35.   tries = tries+1
  36.   print (maxtries - tries, " tries left.")
  37.   sleep(1)
  38.   lock()
  39.  end
  40. end
  41. end
  42. function correct()
  43.  sleep(1)
  44.  shell.run("clear")
  45.  shell.run("shell")
  46. end
  47. function password()
  48.  write "Input password: "
  49.  user=io.read()
  50. end
  51. lock()
Add Comment
Please, Sign In to add comment