Advertisement
Guest User

Untitled

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