..
This commit is contained in:
parent
d6c6b3e6da
commit
0e51130bfb
6
mark.lua
6
mark.lua
@ -5,6 +5,7 @@ machines = {}; machines.pos1 = {}; machines.pos2 = {};
|
||||
machines.marker1 = {}
|
||||
machines.marker2 = {}
|
||||
machines.marker_region = {}
|
||||
machines.timer = 10;
|
||||
|
||||
|
||||
|
||||
@ -65,13 +66,16 @@ minetest.register_entity(":machines:pos1", {
|
||||
physical = false,
|
||||
},
|
||||
on_step = function(self, dtime)
|
||||
if machines.marker1[self.name] == nil then
|
||||
machines[self.name].timer = machines[self.name].timer - dtime
|
||||
if machines[self.name].timer<=0 or machines.marker1[self.name] == nil then
|
||||
self.object:remove()
|
||||
machines[self.name].timer = 10
|
||||
end
|
||||
end,
|
||||
on_punch = function(self, hitter)
|
||||
self.object:remove()
|
||||
machines.marker1[self.name] = nil
|
||||
machines[self.name].timer = 10
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -491,16 +491,16 @@ minetest.register_abm({
|
||||
if not table.mesecons then return end -- error
|
||||
if not table.mesecons.effector then return end -- error
|
||||
local effector=table.mesecons.effector;
|
||||
|
||||
|
||||
if trigger then -- activate target node if succesful
|
||||
meta:set_string("infotext", "detector: on");
|
||||
if not effector.action_on then return end
|
||||
effector.action_on({x=x1,y=y1,z=z1},node); -- run
|
||||
meta:set_string("infotext", "detector: on");
|
||||
|
||||
else
|
||||
meta:set_string("infotext", "detector: idle");
|
||||
if not effector.action_off then return end
|
||||
effector.action_off({x=x1,y=y1,z=z1},node); -- run
|
||||
meta:set_string("infotext", "detector: idle");
|
||||
end
|
||||
|
||||
end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user