Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- pastebin run Rq71t2Ya
- ]]--
- laser = peripheral.wrap("right")
- sensor = peripheral.wrap("left")
- monitor = peripheral.wrap( "back" )
- monitor.setTextScale(2)
- local function fire(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)
- sleep(0.2)
- end
- while(true) do
- local mobs = sensor.sense()
- for _, mob in pairs(mobs) do
- if(mob.displayName == "Guardian of Gaia") then
- local metaData = sensor.getMetaByID(mob.id)
- if(metaData ~= nil) then
- monitor.setCursorPos(1,1)
- monitor.write("Health: " .. metaData.health)
- end
- os.sleep(1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment