Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("right")
- modem.open(42)
- while true do
- local _, _, _, _, payload, distance = os.pullEvent("modem_message")
- if payload ~= nil then
- if payload.target == "service_door_1" and distance <= 5 then
- redstone.setOutput("top", true)
- os.sleep(3)
- redstone.setOutput("top", false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement