ZathegamE

player detector or smth.lua

Apr 25th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. localdetector = peripheral.find("playerDetector")
  2. while true do
  3. players = localdetector.getPlayersInRange(1)
  4. if players ~= nil
  5. then
  6.     term.clear()
  7.     term.setCursorPos(1,1)
  8.     term.write(#players)
  9.     if #players >=1 then rs.setOutput("top",true)
  10.     else
  11.     rs.setOutput("top",false)
  12. end
  13. end
  14. sleep(0.2)
  15. end
Add Comment
Please, Sign In to add comment