Trying to solve an issue with files being locked

This commit is contained in:
2022-11-22 01:20:16 -05:00
parent 293822f2a9
commit b1fa8c6a75
4 changed files with 145 additions and 7 deletions

View File

@@ -14,11 +14,41 @@ minetest.register_node("cops:pig_spawner", {
minetest.register_abm({
nodenames = {"cops:pig_spawner"},
--neighbors = {"default:water_source", "default:water_flowing"},
interval = 30, -- Run every 10 seconds
chance = 5, -- One node has a chance of 1 in 50 to get selected
interval = 30,
chance = 5,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.add_entity(pos, "cops:cop_regular_female")
local i = math.random(0, 2)
if i == 0 then
minetest.add_entity(pos, "cops:cop_regular_female")
elseif i == 1 then
minetest.add_entity(pos, "cops:cop_regular_male")
elseif i == 2 then
minetest.add_entity(pos, "cops:cop_armedthug")
end
end})
minetest.register_abm({
nodenames = {"main:bricks_stone"},
interval = 40,
chance = 50,
action = function(pos, node, active_object_count, active_object_count_wider)
newPos = {x = pos.x, y = pos.y + 2, z = pos.z}
local i = math.random(0, 2)
if i == 0 then
minetest.add_entity(newPos, "cops:cop_regular_female")
elseif i == 1 then
minetest.add_entity(newPos, "cops:cop_regular_male")
elseif i == 2 then
minetest.add_entity(newPos, "cops:cop_armedthug")
end
end})
-- Cops