Posted 03 October 2014 - 10:27 PM
Hello, so I wanted to setup a door that sends a redstone pulse one way if a password is correct and another if incorrect but I keep getting an error, could someone please help?
os.pullEvent = os.pullEventRaw
correctpass = "1447"
while true do
term.clear()
term.setCursorPos(1,1)
write("Safe Code: ")
local input = read("*")
if input == correctpass then
term.clear()
term.setCursorPos(1,1)
print("Safe Cracked! Enter and contact a staff member to receive your reward!")
rs.setOutput(side,true)
sleep(opentime)
rs.setOutput(side,false)
else
term.clear()
term.setCursorPos(1,1)
print("Failed to Crack Safe! You hear the alarm sounding…")
rs.setOutput(left,true)
sleep(opentime)
rs.setOutput(right,false)
sleep(2) endend
os.pullEvent = os.pullEventRaw
correctpass = "1447"
while true do
term.clear()
term.setCursorPos(1,1)
write("Safe Code: ")
local input = read("*")
if input == correctpass then
term.clear()
term.setCursorPos(1,1)
print("Safe Cracked! Enter and contact a staff member to receive your reward!")
rs.setOutput(side,true)
sleep(opentime)
rs.setOutput(side,false)
else
term.clear()
term.setCursorPos(1,1)
print("Failed to Crack Safe! You hear the alarm sounding…")
rs.setOutput(left,true)
sleep(opentime)
rs.setOutput(right,false)
sleep(2) endend
Edited on 03 October 2014 - 08:28 PM