Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.unloadAPI("sensors")
- os.loadAPI("/rom/apis/sensors")
- targets = sensors.getAvailableTargetsforProbe(controller,sensorName,probeName)
- while true do
- -- Loop through this list of targets getting the info about each one
- for i=1,# targets do
- -- Get the target data, i.e. x,y,z coods and type
- targetData = sensors.getSensorReadingAsDict(controller,sensorName,targets[i],probeName)
- -- If the target is a player, i.e. has the name "vq" then check if it is close
- if targetData["name"] == "hosscat" then
- rs.setOutput("bottom",true)
- elseif targetData["name"]
- os.reboot()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement