Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SensorSide = "left"
- local badNPC = {"Zombie","Enderman","Skeleton","Creeper","Spider"}
- local goodNPC = {"Pig","Cow","Chicken","SnowGolem"}
- local trusted = {"gfcwfzkm","Zachecho"}
- os.loadAPI("ocs/apis/sensor") --Load Sensor API
- local prox = sensor.wrap(SensorSide) --Sensor Side
- local targets = prox.getTargets() --Find People/NPCs
- function CheckMob( Str )
- for ii,xx in pairs(badNPC) do
- if string.match(Str,ii) == true then
- term.setTextColor(colors.blue)
- return true
- end
- end
- for ii,xx in pairs(goodNPC) do
- if string.match(Str,ii) == true then
- term.setTextColor(colors.lightBlue)
- return true
- end
- end
- for ii,xx in pairs(trusted) do
- if string.match(Str,ii) == true then
- term.setTextColor(colors.green)
- return true
- end
- end
- end
- for name, basicDetails in pairs(targets) do
- CheckMob( name )
- print("Found entity: "..name)
- term.setTextColor(colors.white)
- local moreDetails = prox.getTargetDetails(name)
- print("Health: "..moreDetails.Health)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement