Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.wrap("left")
- local laser = peripheral.wrap("right")
- local mvcount = 0
- function firelaser(entity)
- local x, y, z = entity.x, entity.y, entity.z
- local pitch = -math.atan2(y, math.sqrt(x * x + z * z))
- local yaw = math.atan2(-x, z)
- laser.fire(math.deg(yaw), math.deg(pitch), 5)
- end
- while true do
- for _, entity in pairs(sensor.sense()) do
- if entity.name ~= "OwOInori" and entity.name ~= "firefly969" and entity.name ~= "Item" and entity.name ~= "XPOrb" and entity.name ~= "plethora:laser" then
- firelaser(entity)
- sleep(0.1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement