Advertisement
ChaosWormz

TNT priv

Apr 28th, 2015
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. minetest.register_node("tnt:tnt", {
  2. description = "TNT",
  3. tiles = {"tnt_top.png", "tnt_bottom.png", "tnt_side.png"},
  4. groups = {dig_immediate=2, mesecon=2},
  5. sounds = default.node_sound_wood_defaults(),
  6. on_punch = function(pos, node, puncher)
  7. if puncher:get_wielded_item():get_name() == "default:torch" then
  8. if minetest.get_player_privs(puncher).use_tnt then
  9. minetest.sound_play("tnt_ignite", {pos=pos})
  10. minetest.set_node(pos, {name="tnt:tnt_burning"})
  11. minetest.get_node_timer(pos):start(4)
  12. return
  13. else then
  14. minetest.chat_send_player(puncher, "You don't have the required priv to use tnt.")
  15. return
  16. end
  17. end
  18. end,
  19. mesecons = {effector = {action_on = boom}},
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement