Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local detector = peripheral.find("playerDetector")
- local p1 = { x = -580, y = 61, z = -81 }
- local p2 = { x = -574, y = 64, z = -81 }
- if detector == nil then
- error("playerDetector not in range")
- end
- function PlayerCheck(posOne, posTwo)
- return detector.isPlayersInCoords(posOne, posTwo)
- end
- while true do
- redstone.setOutput("right", false) --This one just turns the redstone signal off so it's not kept on after the player leaves
- if PlayerCheck(p1, p2) == true then
- redstone.setOutput("right",true)
- else
- print("Nope.\n")
- end
- sleep(0)
- end
Add Comment
Please, Sign In to add comment