jojoa1997 wrote:i was able to make it by changing the names from animal_vombie:vombie to npc:npc but i could not hit the blocks or the game would crash
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)}, "npc:npc")
end
if use_mesecons == true then
minetest.register_node("npc:npc_spawner", {
description = "Box 'O NPCs",
drawtype = "glasslike",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
tiles = {"default_glass.png"},
sunlight_propagates = true,
param2 = "light",
mesecons = {effector = {
action_on = npc_spawner
}}
})
end
if use_mesecons == false then
minetest.register_node("npc:npc_spawner", {
description = "Box 'O NPCs",
drawtype = "glasslike",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
tiles = {"default_glass.png"},
sunlight_propagates = true,
param2 = "light",
})
minetest.register_abm({
nodenames = {"npc:npc_spawner"},
interval = 1.0,
chance = 20,
action = function(pos)
npc_spawner(pos)
end,
})
end
jojoa1997 wrote:and where do i put this
Users browsing this forum: No registered users and 3 guests