if pointed_thing.type=="node" then
item=itemstack:to_table()
local meta=get_item_meta(item["metadata"])
- if meta==nil then return false end --tool not charghed
- if meta["charge"]==nil then return false end
+ if meta==nil then return end --tool not charghed
+ if meta["charge"]==nil then return end
charge=meta["charge"]
charge_to_take=600;
if charge-charge_to_take>0 then
if pointed_thing.type=="node" then
item=itemstack:to_table()
local meta=get_item_meta(item["metadata"])
- if meta==nil then return false end --tool not charghed
- if meta["charge"]==nil then return false end
+ if meta==nil then return end --tool not charghed
+ if meta["charge"]==nil then return end
charge=meta["charge"]
if charge-mining_drill_power_usage>0 then
charge_to_take=drill_dig_it(minetest.get_pointed_thing_position(pointed_thing, above),user,1,1)
if meta==nil or keys["sneak"]==true then return mining_drill_mk2_setmode(user,itemstack) end
if meta["mode"]==nil then return mining_drill_mk2_setmode(user,itemstack) end
if pointed_thing.type~="node" then return end
- if meta["charge"]==nil then return false end
+ if meta["charge"]==nil then return end
charge=meta["charge"]
if charge-mining_drill_power_usage>0 then
local charge_to_take=drill_dig_it(minetest.get_pointed_thing_position(pointed_thing, above),user,2,meta["mode"])
if meta==nil or keys["sneak"]==true then return mining_drill_mk3_setmode(user,itemstack) end
if meta["mode"]==nil then return mining_drill_mk3_setmode(user,itemstack) end
if pointed_thing.type~="node" then return end
- if meta["charge"]==nil then return false end
+ if meta["charge"]==nil then return end
charge=meta["charge"]
if charge-mining_drill_power_usage>0 then
print(dump(meta))
on_use = function(itemstack, user, pointed_thing)
item=itemstack:to_table()
local meta=get_item_meta(item["metadata"])
- if meta==nil then return false end --tool not charghed
- if meta["charge"]==nil then return false end
+ if meta==nil then return end --tool not charghed
+ if meta["charge"]==nil then return end
charge=meta["charge"]
if charge-400>0 then
laser_shoot(item, user, pointed_thing)
if node.param2==nil then return end
item=itemstack:to_table()
local meta1=get_item_meta(item["metadata"])
- if meta1==nil then return false end --tool not charghed
- if meta1["charge"]==nil then return false end
+ if meta1==nil then return end --tool not charghed
+ if meta1["charge"]==nil then return end
charge=meta1["charge"]
if charge-100>0 then
minetest.sound_play("technic_sonic_screwdriver", {pos = pos, gain = 0.3, max_hear_distance = 10,})