Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local left = redstone.getInput("left")
- local right = redstone.getInput("right")
- function SoundAlarm()
- for i=1,5 do
- redstone.setOutput("top",true)
- os.sleep(0.5)
- redstone.setOutput("top",false)
- os.sleep(0.5)
- end
- end
- while true do
- os.pullEvent("redstone")
- newLeft = redstone.getInput("left")
- newRight = redstone.getInput("right")
- if ( ( newLeft == false and left == true ) or ( newRight == false and right == true) ) then
- SoundAlarm()
- end
- left = newLeft
- right = newRight
- os.sleep(5)
- end
Add Comment
Please, Sign In to add comment