Guest User

Untitled

a guest
May 20th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local mobsclose = 0
  2.  
  3. for _, obj in ipairs(minetest.get_objects_inside_radius(mobpos, 10)) do
  4. if not obj:is_player() then
  5. mobsclose = mobsclose + 1
  6.  
  7. if mobsclose >= 4 then
  8. if obj:get_luaentity() then
  9.  
  10. local mobhp = obj:get_luaentity().health
  11. local mobmhp = obj:get_luaentity().hp_max
  12.  
  13. if mobhp and modmhp then
  14. if mobhp == mobmhp then
  15. obj:remove()
  16. end
  17. end
  18. end --- IF OBJ IS ENTITY END
  19. end --- IF MORE THAN 3 MOBS CLOSE TO PLAYER END
  20. end --- IF OBJECT NO PLAYER END
  21. end --- LOOP END
Advertisement
Add Comment
Please, Sign In to add comment