Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- load the API
- os.loadAPI("ocs/apis/sensor")
- -- wrap the sensor
- prox = sensor.wrap("left")
- -- get the targets
- local targets = prox.getTargets()
- -- loop through them
- for name, basicDetails in pairs(targets) do
- -- print their name
- print("Found entity: "..name)
- -- get more details about them
- local moreDetails = prox.getTargetDetails(name)
- -- print their health
- print("Health: "..moreDetails.Health)
- print("Health: "..moreDetails.Position.X)
- print("------")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement