Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local side = "left"
- local password = "keter"
- local opentime = 5
- while true do
- term.clear() -- Clears the screen
- term.setCursorPos(1,1)
- write("Enter Password: ")
- local input = read("*")
- if input == password then -- Checks if the user inputted the correct password
- term.clear() -- Already explained up top
- term.setCursorPos(1,1)
- print("Password correct!")
- rs.setOutput(side,true)
- sleep(opentime)
- rs.setOutput(side,false) -- Stop outputting a redstone current
- else -- Checks if the user didn't input the correct password
- print("Password incorrect!") -- Prints 'Password incorrect!' to the screen
- sleep(2) -- Waits 2 seconds
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement