View difference between Paste ID: yZCGnnkK and sm3cxuet
SHOW: | | - or go back to the newest paste.
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
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/never.dfpwm")
16+
  shell.run("speaker","play","http://172.245.82.93/mc/never2.dfpwm")
17-
  os.sleep(10)
17+
18-
  shell.run("speaker","stop")
18+
19
  else
20
  print("Sleeping")
21
  os.sleep(2)
22
  end    
23
end