Advertisement
Guest User

kill

a guest
Jun 24th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local sensor = peripheral.wrap("left")
  2. local laser = peripheral.wrap("right")
  3. local mvcount = 0
  4.  
  5. function firelaser(entity)
  6.     local x, y, z = entity.x, entity.y, entity.z
  7.     local pitch = -math.atan2(y, math.sqrt(x * x + z * z))
  8.     local yaw = math.atan2(-x, z)
  9.    
  10.     laser.fire(math.deg(yaw), math.deg(pitch), 5)
  11.    
  12. end
  13.  
  14. while true do
  15.     for _, entity in pairs(sensor.sense()) do
  16.         if entity.name ~= "OwOInori" and entity.name ~= "firefly969" and entity.name ~= "Item" and entity.name ~= "XPOrb" and entity.name ~= "plethora:laser" then
  17.             firelaser(entity)
  18.             sleep(0.1)
  19.         end
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement