Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minetest.register_chatcommand("ce", {
- params = "[<range>]",
- description = "Counts entities in a <range> radius sphere. Default is 5.",
- func = function(name, param)
- local n = tonumber(param)
- if n == nil then n = 5 end
- local p = minetest.get_player_by_name(name)
- local l = minetest.get_objects_inside_radius(p:getpos(), n)
- minetest.chat_send_player(name, "There are "..(#l).." entities in the area.")
- end,
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement