Posted 22 January 2016 - 10:49 PM
hey.. so i have a question. i want to make a door that when you type one password it outputs redstone to one side and when you type a different one it outputs to a different side. any suggestions
while true do --# Infinite loop
local input = read() --# Let the user type a password
if input == "myPassword" then --# User entered 'myPassword'
rs.setOutput("back",true)
print("Correct!")
sleep(2)
rs.setOutput("back",false)
else --# User entered something else
rs.setOutput("bottom",true)
print("Wrong!")
sleep(2)
rs.setOutput("bottom",false)
end
end
Something like this should work:while true do --# Infinite loop local input = read() --# Let the user type a password if input == "myPassword" then --# User entered 'myPassword' rs.setOutput("back",true) print("Correct!") sleep(2) rs.setOutput("back",false) else --# User entered something else rs.setOutput("bottom",true) print("Wrong!") sleep(2) rs.setOutput("bottom",false) end end
Note that it isn't very secure, I tried to keep it simple for now
os.pullEvent = os.pullEventRaw