Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mobsclose = 0
- for _, obj in ipairs(minetest.get_objects_inside_radius(mobpos, 10)) do
- if not obj:is_player() then
- mobsclose = mobsclose + 1
- if mobsclose >= 4 then
- if obj:get_luaentity() then
- local mobhp = obj:get_luaentity().health
- local mobmhp = obj:get_luaentity().hp_max
- if mobhp and modmhp then
- if mobhp == mobmhp then
- obj:remove()
- end
- end
- end --- IF OBJ IS ENTITY END
- end --- IF MORE THAN 3 MOBS CLOSE TO PLAYER END
- end --- IF OBJECT NO PLAYER END
- end --- LOOP END
Advertisement
Add Comment
Please, Sign In to add comment