node.lua 661 B

123456789101112131415161718192021
  1. minetest.register_node('mail:mailbox', {
  2. description = 'Mail Box',
  3. drawtype = 'mesh',
  4. mesh = 'mail_mailbox.obj',
  5. tiles = {'mail_mailbox_uv.png'},
  6. paramtype = 'light',
  7. paramtype2 = 'facedir',
  8. sunlight_propagates = true,
  9. groups = {breakable=1},
  10. on_rightclick = function(pos, node, clicker)
  11. local name = clicker:get_player_name()
  12. local player_attributes = clicker:get_meta()
  13. local mode = player_attributes:get_string('mode')
  14. if mode ~= 'traitor' and mode ~= 'player' then
  15. mail.show_inbox(name)
  16. else
  17. minetest.chat_send_player(name, 'You can\'t check your mail now.')
  18. end
  19. end
  20. })