Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("password.txt") then
- write("Please enter your password. You must ask Nathan if you wish to change it: ")
- status,newpwd = pcall(read)
- file = fs.open("password.txt","w")
- file.writeLine(newpwd)
- file.close()
- end
- pwdfile = fs.open("password.txt","r")
- password = pwdfile.readLine()
- pwdfile.close()
- while true do
- term.clear()
- term.setCursorPos(1,1)
- write("Enter Password: ")
- status,pwd=pcall(read)
- if pwd == password then
- term.clear()
- print("Password Accepted!")
- redstone.setOutput("left",true)
- for i=0,5 do
- x,y = term.getCursorPos()
- term.clearLine()
- term.setCursorPos(1,y)
- write("You have "..(5-i).." seconds left")
- pcall(sleep,1)
- end
- elseif pwd == "adminmode" then
- term.clear()
- sleep(5)
- else
- print("Password not accepted")
- pcall(sleep,5)
- end
- write("\n")
- redstone.setOutput("left",false)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement