aregrubb

Untitled

Jan 4th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local detector = peripheral.find("playerDetector")
  2. local p1 = { x = -580, y = 61, z = -81 }
  3. local p2 = { x = -574, y = 64, z = -81 }
  4. if detector == nil then
  5.     error("playerDetector not in range")
  6. end
  7. function PlayerCheck(posOne, posTwo)
  8.     return detector.isPlayersInCoords(posOne, posTwo)
  9. end
  10. while true do
  11.     redstone.setOutput("right", false) --This one just turns the redstone signal off so it's not kept on after the player leaves
  12.     if PlayerCheck(p1, p2) == true then
  13.         redstone.setOutput("right",true)
  14.     else
  15.         print("Nope.\n")
  16.     end
  17. sleep(0)
  18. end
Add Comment
Please, Sign In to add comment