Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local side1 = "left" -- The side the sensor is on
- local side2 = "right" -- The side the door is on
- local time = 5 -- Time the door should be open
- local names = {"netchip", "bas"}
- sensor = peripheral.wrap(side1)
- while true do
- for i,v in pairs(sensor.getPlayerNames())
- for k,y in pairs(names) do
- if tostring(v) == tostring(y) then
- rs.setOutput(side2, true)
- sleep(time)
- rs.setOutput(side2, false)
- end
- end
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment