SHARE
TWEET

Untitled

a guest Dec 10th, 2018 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --The igniter tool
  2. minetest.register_tool("flint_and_steel:flint_and_strike", {
  3.     description = "Flint and Strike",
  4.     inventory_image = "flint_and_steel.png",
  5.     stack_max = 1,
  6.     on_use = function(itemstack, user, pointed_thing)
  7.     if pointed_thing.type=="node" then
  8.             if minetest.env:get_node(pointed_thing.above).name == "air" then
  9.                 minetest.sound_play("flint", {pos=pointed_thing.under, loop=false})
  10.                 item = itemstack:to_table()
  11.                 item_wear = tonumber(item["wear"])
  12.                 item_wear = item_wear + 1000
  13.                 item["wear"]=tostring(item_wear)
  14.                 if item_wear > 63000 then
  15.                     item = ""
  16.                 end
  17.                 itemstack:replace(item)
  18.                 minetest.env:add_node(pointed_thing.above, {name="fire:basic_flame"})
  19.                 return itemstack
  20.             end
  21.         end
  22.     end
  23. end,
  24. })
  25.  
  26. minetest.register_craft({
  27.     type = "shapeless",
  28.     output = 'torch_plus:lighter 1',
  29.     recipe = {
  30.         'default:steel_ingot',
  31.         'default:cobble',
  32.     }
  33. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top