Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on_rightclick = function(pos, node, puncher, itemstack, pointed_thing)
- local wieldname = itemstack:get_name()
- local fdir_to_fwd = { {0, -1}, {-1, 0}, {0, 1}, {1, 0} }
- local fdir = node.param2
- local pos_drop = { x=pos.x+fdir_to_fwd[fdir+1][1], y=pos.y, z=pos.z+fdir_to_fwd[fdir+1][2] }
- if wieldname == "default:stick" then
- itemstack:take_item()
- minetest.spawn_item(pos_drop, "default:brick")
- minetest.sound_play("thankyou", {
- pos=pos, max_hear_distance = 5
- })
- minetest.chat_send_player(puncher:get_player_name(), "Thank you! heres something i found during my travels nomnomnom... ")
- return itemstack
- else
- minetest.chat_send_player(puncher:get_player_name(), "i miss my homeland, the bread there was delicious")
- end
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement