adamg765

Untitled

Jan 14th, 2024 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. while true do
  2. local detector = peripheral.find("playerDetector")
  3. local playerList = detector.getPlayersInRange(7)
  4.  
  5. count = 0
  6. for _ in pairs(playerList) do count = count + 1 end
  7. print("count")
  8. if(count == 0) then
  9. redstone.setOutput("top", false)
  10. print("no")
  11. end
  12.  
  13. for k,v in pairs(playerList) do
  14. redstone.setOutput("top", true)
  15. print("yes")
  16. end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment