Advertisement
Guest User

Untitled

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