Advertisement
cochise57

Untitled

Jul 27th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. -- load the API
  2. os.loadAPI("ocs/apis/sensor")
  3. -- wrap the sensor
  4. prox = sensor.wrap("left")
  5. -- get the targets
  6. local targets = prox.getTargets()
  7. -- loop through them
  8. for name, basicDetails in pairs(targets) do
  9. -- print their name
  10. print("Found entity: "..name)
  11. -- get more details about them
  12. local moreDetails = prox.getTargetDetails(name)
  13. -- print their health
  14. print("Health: "..moreDetails.Health)
  15. print("------")
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement