Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.find('openperipheral_sensor')
- function Main()
- local pList = sensor.getPlayers()
- for k,v in pairs(pList) do
- pcall(function() player = sensor.getPlayerByUUID(v.uuid) end)
- if math.abs(player.position.x) <=3 and math.abs(player.position.y) <=5 and math.abs(player.position.z) <= 2 then
- redstone.setOutput('right',true)
- return
- end
- if k == #pList then
- redstone.setOutput('right',false)
- end
- end
- end
- while true do
- Main()
- sleep(0.3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement