Advertisement
Guest User

scan

a guest
Jul 17th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. pcX = 1
  2. pcY = 1
  3. pcZ = 1
  4. basename = temp
  5.  
  6. players2 = {}
  7.  
  8. t = peripheral.wrap("top")
  9. while true do
  10. -- reports if enemy is inside!
  11.    
  12.     local people = t.getPlayers()
  13.    
  14.     for i,v in pairs(people) do
  15.         if players2[v.name] == nil then
  16.         -- whitelist names here (otherwise will spam!)
  17.             if
  18.             v.name ~= "TheNetPle" and
  19.             v.name ~= "  "
  20.             then    
  21.                 players2[v.name] = t.getPlayerByName(v.name).all()
  22.                 x2 = players2[v.name].position.x
  23.                 y2 = players2[v.name].position.y
  24.                 z2 = players2[v.name].position.z
  25.                 -- ONLY REPORTS WHEN IN RANGE OF 10. Change values to your liking
  26.                 if (x2 < 10 and x2 > -10 and y2 < 10 and y2 > -10 and z2 < 10 and z2 > -10) then
  27.                 print(players2[v.name].name)
  28.                    
  29.                     sleep(1.00)
  30.  
  31.                 end    
  32.             end    
  33.             players2[v] = nil
  34.         end
  35.     end
  36.    
  37.     local people = nil
  38.     players2 = {}
  39.    
  40. sleep(0.05)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement