Advertisement
FFGFlash

AR

May 30th, 2021 (edited)
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local plr_detector = peripheral.wrap("right")
  2. local env_detector = peripheral.wrap("left")
  3. local ar = peripheral.wrap("bottom")
  4.  
  5. local range = 50
  6.  
  7. ar.setRelativeMode(true, 1600, 900)
  8.  
  9. local relative,width,height = ar.isRelativeMode()
  10.  
  11. while true do
  12.   local timer = os.startTimer(1)
  13.   local event,id
  14.   repeat event,id = os.pullEvent("timer") until id == timer
  15.  
  16.   local inRange = plr_detector.isPlayersInRange(range)
  17.   local players = plr_detector.getPlayersInRange(range)
  18.  
  19.   ar.clear()
  20.   if inRange then
  21.     ar.drawString("Players:", 5, 10, 0x44BD32)
  22.     for i,plr in ipairs(players) do ar.drawString(plr, 10, 10 + 20 * i, 0xF5F6FA) end
  23.   end
  24. end
  25.  
  26. for x=0, width, 100 do for y=0, height, 100 do ar.drawItemIcon("minecraft:rotten_flesh", x, y) end end
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement