Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- right = function()
- redstone.setOutput("right", false)
- while not redstone.getInput("right") do
- os.queueEvent("randomEvent")
- os.pullEvent()
- end
- return "left"
- end
- left = function()
- redstone.setOutput("left", false)
- while not redstone.getInput("left") do
- os.queueEvent("randomEvent")
- os.pullEvent()
- end
- return "right"
- end
- while true do
- side = parallel.waitForAny(left, right)
- if side == 1 then
- redstone.setOutput("right", true)
- os.sleep(3)
- redstone.setOutput("right", false)
- end
- if side == 2 then
- redstone.setOutput("left", true)
- os.sleep(3)
- redstone.setOutput("left", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment