Posted 04 November 2012 - 09:34 AM
Right, so yer! I made this code as me and my brother are doing a playthrough only using turtles computers etc (No mining or any crap like that :D/>/>). We're fighting to win against one another and I needed to protect my house so I came up with this:
Hope This helped. Basically what it does is uses variables to count down how many attempts are left before the computer is locked or what have you.
:)/>/>
term.clear() term.setCursorPos(1,1)
y = 3
local password = "dark"
while true do
print("Attempts left:"..y) -- Add In Variable!
write("Enter Password Here:")
local passwordRead = read("*")
if passwordRead == password then
rs.setOutput("right",true)
sleep(2)
rs.setOutput("right",false)
os.shutdown()
else
print("Try Again")
term.clear()
y = y-1
if y == 0 then
print("Chances Up Locking Computer!")
sleep(15)
os.shutdown()
end
end
end
Hope This helped. Basically what it does is uses variables to count down how many attempts are left before the computer is locked or what have you.
:)/>/>
if hungerLevel() > 1 then
playMoreCC()
end