Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. on_rightclick = function(pos, node, puncher, itemstack, pointed_thing)
  2. local wieldname = itemstack:get_name()
  3. local fdir_to_fwd = { {0, -1}, {-1, 0}, {0, 1}, {1, 0} }
  4. local fdir = node.param2
  5. local pos_drop = { x=pos.x+fdir_to_fwd[fdir+1][1], y=pos.y, z=pos.z+fdir_to_fwd[fdir+1][2] }
  6. if wieldname == "default:stick" then
  7. itemstack:take_item()
  8. minetest.spawn_item(pos_drop, "default:brick")
  9. minetest.sound_play("thankyou", {
  10. pos=pos, max_hear_distance = 5
  11. })
  12. minetest.chat_send_player(puncher:get_player_name(), "Thank you! heres something i found during my travels nomnomnom... ")
  13. return itemstack
  14. else
  15. minetest.chat_send_player(puncher:get_player_name(), "i miss my homeland, the bread there was delicious")
  16. end
  17. end
  18. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement