Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require('component')
- local motion = component.motion_sensor
- local event = require('event')
- local redstone = component.redstone
- local evlistener = {}
- local function setDoorState(isOpened)
- for address in component.list("redstone") do component.proxy(address).setOutput(1, isOpened and 15 or 0)
- end
- end
- while true do
- os.sleep(1)
- evlistener = {event.pull()}
- if evlistener[6] == "ThisJoda" or evlistener[6] == "KirillKot" then
- setDoorState(true)
- os.sleep(3)
- setDoorState(false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement