Advertisement
Guest User

ia

a guest
Apr 26th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local speaker = peripheral.wrap("right")
  2. local time = peripheral.wrap("bottom")
  3. local detect = peripheral.wrap("left")
  4.  
  5. local playerConnect = {}
  6. local playerControl = {maximlab1=1,Batponney=1}
  7.  
  8. function detection(distanceDetect,langSpeack)
  9.   local timeNow = time.getDate()
  10.   local players = detect.getNearbyPlayers(distanceDetect)
  11.   local here = {}
  12.   for i=1, #players do
  13.     local name = players[i].player
  14.     here[name]=true
  15.     if not playerConnect[name] then
  16.       if playerControl[name] then
  17.         speaker.speak((timeNow.hour>18 and "Bonsoir" or "Bonjour")..name, distanceDetect, langSpeack)
  18.       end
  19.     end
  20.   end
  21.   playerConnect=here
  22. end
  23.  
  24. while true do
  25.   detection(50,"fr")
  26.   sleep(1)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement