Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use_mesecons = false
- function npc_spawner(pos)
- minetest.env:add_entity({x=pos.x+math.random(-1,1),y=pos.y+math.random(2,3),z=pos.z+math.random(-1,1)}, "peaceful_npc:npc")
- -- Count the number of times a value occurs in a table
- function table_count(tt, item)
- local count
- count = 0
- for ii,xx in pairs(tt) do
- if item == xx then count = count + 1 end
- end
- return count
- end
- --[[ local count = minetest.env:get_objects_inside_radius(pos, 20)
- local MAX_NPC = 3
- if count>MAX_NPC then
- action_off = minetest.env:add_entity({x=pos.x+math.random(-1,1),y=pos.y+math.random(2,3),z=pos.z+math.random(-1,1)}, "peaceful_npc:npc")
- end
- end]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement