Advertisement
ElijahCrafter

OS

Mar 26th, 2025
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. if fs.exists("config.txt") == true then
  2.  
  3. local file = fs.open("config.txt", "r")
  4. local config = file.readAll()
  5. file.close()
  6.  
  7. local lines = {}
  8. for line in string.gmatch(config, "[^\r\n]+") do
  9.     table.insert(lines, line)
  10. end
  11.  
  12. local name = lines[1]
  13.  
  14. print("Hello ".. name .." please enter your password.")
  15.  
  16. right = lines[2]
  17.  
  18. function password()
  19.     entered = read("*")
  20.     if entered == right then
  21.         print("Correct welcome ")
  22.         sleep(1)
  23.         shell.run("clear")
  24.         shell.run("windows")
  25.         else
  26.         print("Wrong password")
  27.         sleep(0.5)
  28.         shell.run("clear")
  29.         print("Try again")
  30.         password()
  31.     end
  32. end
  33.  
  34. password()
  35.  
  36. else
  37. shell.run("register")
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement