Advertisement
dlo009

funct

May 20th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. function getPass(checkPass)
  2.    local pass = ""
  3.    
  4.    term.write("Please enter the password: ")
  5.    pass = read()
  6.    if pass ~= checkPass then
  7.       print("Wrong Password!!")
  8.       return false
  9.    else
  10.       print("Correct Password!!")
  11.       return true
  12.    end
  13. end
  14.  
  15. --Main Program Below!!!
  16.  
  17. print("Starting Program!")
  18. while not getPass("dw20") do
  19.    print("Please try again")
  20. end
  21. print("Lets do stuff")
  22. while not getPass("password") do
  23.    print("No really, try again!")
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement