daily pastebin goal
52%
SHARE
TWEET

Untitled

Vispoh Feb 17th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local sensor = peripheral.wrap('left')
  2. local teleposer = peripheral.wrap('right')
  3.  
  4. redstone.setOutput('right', false)
  5.  
  6. whiteList =
  7. {
  8. --players
  9. 'DChacha777',
  10. 'TrayvonMartin2',
  11. 'GeorgeZimmerman7', -- potentially incorrect
  12. 'DerpyFoodz',
  13. --annoying ass admins
  14. 'lagon8',
  15. 'TheNetPlex',
  16. 'ashley1213',
  17. 'Setheren',
  18. 'Rhodderz',
  19. 'ABT11',
  20. 'UThicc',
  21. 'EnderDemon72',
  22. 'ItsHighNo0n',
  23. 'Newt02',
  24. 'AkameMashiru',
  25. }
  26.  
  27. --Compare string to table using
  28. table.contains = function(self, element)
  29.   for k,v in pairs(self) do
  30.     if v == element then
  31.       return true
  32.     end
  33.   end
  34.   return false
  35. end
  36.  
  37. --Main loop
  38. while true do
  39.  
  40.   playerTable = sensor.getPlayers()
  41.  
  42.   for i = 1,#playerTable do
  43.    
  44.     playerName = playerTable[i]["name"]
  45.    
  46.     if table.contains(whiteList, playerName)
  47.     then
  48.     else
  49.       redstone.setOutput('right', true)
  50.       sleep(1)
  51.       teleposer.destroyStack(1)
  52.       redstone.setOutput('right', false)
  53.       os.reboot()
  54.     end
  55.   end
  56. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top