Advertisement
paint812

Untitled

Jan 16th, 2022 (edited)
899
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local d = peripheral.find("playerDetector")
  2.  
  3. function getPlayers(r)
  4.     local p = d.getPlayersInRange(r)
  5.     for k,v in pairs(p) do
  6.         if v ~= "Xubex" then
  7.         print("detected Kevin")
  8.         return true
  9.         end
  10.     end
  11.     return false
  12. end
  13.  
  14. while true do
  15.   if getPlayers(10) then
  16.   shell.run("speaker","play","http://172.245.82.93/mc/never2.dfpwm")
  17.   print("long sleep")
  18.   os.sleep(120)
  19.   else
  20.   print("Sleeping")
  21.   os.sleep(2)
  22.   end    
  23. end
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement