Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this code will automatically send a redstone signal when a player is nearby
- -- useful for auto opening doors when a player is near
- local detector = peripheral.find("playerDetector") -- Finds the peripheral if one is connected
- if detector == nil then error("playerDetector not found") end
- redstone.setOutput("back", true) -- set door to closed on startup
- while true do
- if detector.isPlayersInRange(15) == true then
- redstone.setOutput("back", false)
- else
- redstone.setOutput("back", true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement