functions.lua 801 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --[[
  2. function griefer.get_griefer_count(pos)
  3. local ents = minetest.get_objects_inside_radius(pos, 10)
  4. local count = 0
  5. for k, v in ipairs(ents) do
  6. if not v:is_player() then
  7. local tb = v:get_luaentity()
  8. if tb and tb.mob then
  9. if tb.name and tb.name == "griefer:griefer" then
  10. -- Found monster in radius.
  11. count = count + 1
  12. end
  13. end
  14. end
  15. end
  16. return count
  17. end
  18. function griefer.on_stone_construct(pos)
  19. minetest.get_node_timer(pos):start(math.random(10, 60)
  20. end
  21. function griefer.on_stone_timer(pos, elapsed)
  22. minetest.get_node_timer(pos):start(math.random(10, 60)
  23. end
  24. --]]
  25. if not griefer.run_functions_once then
  26. local c = "griefer:functions"
  27. local f = griefer.modpath .. "/functions.lua"
  28. reload.register_file(c, f, false)
  29. griefer.run_functions_once = true
  30. end