--version2 local monitor = peripheral.wrap("monitor_0") --greeting function function Greet() monitor.setBackgroundColor(colors.blue) monitor.setTextColor(colors.yellow) monitor.setCursorPos(1,1) monitor.setTextScale(3) monitor.clear() monitor.write("Speak Friend") monitor.setCursorPos(3,2) monitor.write("and Enter") end function Wrong() monitor.setBackgroundColor(colors.red) monitor.setTextColor(colors.black) monitor.setCursorPos(2,2) monitor.setTextScale(4) monitor.clear() monitor.write("WRONG!") end function Right() monitor.setBackgroundColor(colors.green) monitor.setTextColor(colors.white) monitor.setCursorPos(2,2) monitor.setTextScale(4) monitor.clear() monitor.write("Welcome!") end --password function function PWD() while true do redstone.setOutput("back", true) term.clear() term.setCursorPos(1, 1) print("Enter Password:") input = read("*") if input == "friend" then redstone.setOutput("back", false) Right() sleep(4) redstone.setOutput("back", true) Greet() else Wrong() sleep(5) Greet() end end end --Main Program Greet() PWD()