Advertisement
Guest User

startup

a guest
Mar 31st, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. local sensor = peripheral.find('openperipheral_sensor')
  2.  
  3. function Main()
  4.     local pList = sensor.getPlayers()
  5.     for k,v in pairs(pList) do
  6.         pcall(function() player = sensor.getPlayerByUUID(v.uuid) end)
  7.         if math.abs(player.position.x) <=3 and math.abs(player.position.y) <=5 and math.abs(player.position.z) <= 2 then
  8.             redstone.setOutput('right',true)
  9.             return
  10.         end
  11.         if k == #pList then
  12.             redstone.setOutput('right',false)
  13.         end
  14.     end
  15. end
  16.  
  17. while true do
  18.   Main()
  19.   sleep(0.3)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement