Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- redstone.setOutput("bottom", false)
- -- load the API
- os.loadAPI("ocs/apis/sensor")
- -- wrap the sensor
- prox = sensor.wrap("right")
- -- get the targets
- local targets = prox.getTargets()
- -- loop through them
- for name, basicDetails in pairs(targets) do
- -- print their name
- print("Found entity: "..name)
- if name == "04Hannez" or name == "Hannez04" then
- print("Has Access: True")
- else
- print("Has Access: false")
- end
- -- get more details about them
- local moreDetails = prox.getTargetDetails(name)
- -- print their health
- print("Health: "..moreDetails.Health)
- print("------")
- sleep(0.5)
- end
- end
Add Comment
Please, Sign In to add comment