Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem")
- modem.open(42131)
- Door = true
- while true do
- local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
- if (channel == 42131) then
- if(tostring(message) =="door") then
- if (Door == true) then
- print("open")
- redstone.setOutput("right", false)
- Door = false
- elseif (Door == false) then
- print("close")
- redstone.setOutput("right", true)
- Door = true
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement