Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local detector = peripheral.find("playerDetector")
- if detector == nil then
- error("playerDetector not in range")
- end
- function PlayerCheck()
- return detector.isPlayersInRange(3)
- end
- while true do
- if PlayerCheck() == true then
- redstone.setOutput("top",true)
- else
- redstone.setOutput("top", false) --This one just turns the redstone signal off so it's not kept on after the player leaves
- print("Nope.\n")
- end
- sleep(0)
- end
Advertisement
Advertisement