make a walking light bug killer abm
This commit is contained in:
parent
2a65c834f1
commit
7e00ebbd8e
@ -119,4 +119,23 @@ minetest.register_node("walking_light:light", {
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {0, 0, 0, 0, 0, 0},
|
fixed = {0, 0, 0, 0, 0, 0},
|
||||||
},
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"walking_light:light"},
|
||||||
|
interval = 10,
|
||||||
|
chance = 1,
|
||||||
|
catch_up = false,
|
||||||
|
action = function(p0, node, _, _)
|
||||||
|
local killlight = true
|
||||||
|
local objs = minetest.get_objects_inside_radius(p0, 2)
|
||||||
|
for _, obj in pairs(objs) do
|
||||||
|
if obj:is_player() then
|
||||||
|
killlight = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if killlight then
|
||||||
|
minetest.remove_node(p0)
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
Loading…
x
Reference in New Issue
Block a user