Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. minetest.register_node("gloopblocks:scaffolding", {
  2. description = "Wooden Scaffold",
  3. drawtype = "allfaces",
  4. paramtype = "light",
  5. sunlight_propagates = true,
  6. tiles = {"gloopblocks_scaffold.png"},
  7. groups = {choppy=3, oddly_breakable_by_hand=3},
  8. sounds = default.node_sound_wood_defaults(),
  9. on_rightclick = function(pos, node, clicker, itemstack)
  10. if itemstack:get_name() == node.name then
  11. for i = 1,19 do
  12. if minetest.get_node({x=pos.x,y=pos.y-i,z=pos.z}).name == "gloopblocks:scaffolding" and scafffound ~= 0 and scafffound ~= 1 then
  13. local scafffound = 1
  14.  
  15. for i = 1,19 do
  16. if minetest.get_node({x=pos.x,y=pos.y+i,z=pos.z}).name == "air" and scaffworked ~= 1 and scaffworked ~= 0 then
  17. minetest.set_node({x=pos.x,y=pos.y+i,z=pos.z}, {name="gloopblocks:scaffolding"})
  18. local scaffworked = 1
  19. return ItemStack(tostring(itemstack:get_name().." "..tostring(itemstack:get_count()-1)))
  20. elseif minetest.get_node({x=pos.x,y=pos.y+i,z=pos.z}).name == "gloopblocks:scaffolding" then
  21. else
  22. local scaffworked = 0
  23. end
  24. end
  25. if scaffworked == 1 then
  26. return ItemStack(tostring(itemstack:get_name().." "..tostring(itemstack:get_count()-1)))
  27. else
  28. return itemstack
  29. end
  30. else return itemstack end
  31. end,
  32. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement