Guest User

Untitled

a guest
Jan 22nd, 2013
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. local proximity = sensor.wrap("top")
  3. repeat
  4.   local targets = proximity.getTargets()
  5.  
  6.   term.clear()
  7.   print("Players in range:-")
  8.  
  9.   for name, details in pairs(targets) do
  10.         if details.Type == "Player" then        
  11.           local status, fullDetails = pcall(proximity.getTargetDetails, name)
  12.  
  13.           if status then  
  14.                 print(fullDetails.Username)
  15.           end          
  16.         end
  17.   end
  18. until false
Advertisement
Add Comment
Please, Sign In to add comment