Social emote bubble for minetest
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.lua 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. socialemote = {}
  2. function socialemote.show_emote(player, coordx, coordy)
  3. local object = minetest.add_entity(player:get_pos(), "socialemote:bubble")
  4. object:set_attach(player, "Head", {x=-3.0, y=7.0, z=0.0}, {x=0, y=0, z=0})
  5. object:set_sprite({x=coordx, y=coordy}, 3, 0.3, false)
  6. minetest.after(5.0, function()
  7. object:remove()
  8. end)
  9. end
  10. minetest.register_entity("socialemote:bubble", {
  11. visual = "sprite",
  12. textures = {"socialemote_all_animated.png"},
  13. spritediv = {x = 6, y = 12},
  14. visual_size={x=0.5, y=0.5, z=0.5},
  15. })
  16. minetest.register_chatcommand("love", {
  17. description = "Shows a beating heart for 5 seconds",
  18. func = function(name, param)
  19. socialemote.show_emote(minetest.get_player_by_name(name), 3, 0)
  20. end })
  21. minetest.register_chatcommand("embarrassed", {
  22. description = "Shows a sweat drop in a bubble",
  23. func = function(name, param)
  24. socialemote.show_emote(minetest.get_player_by_name(name), 1, 6)
  25. end })
  26. minetest.register_chatcommand("exclamation", {
  27. description = "Shows an excalmation mark animation in a bubble",
  28. func = function(name, param)
  29. socialemote.show_emote(minetest.get_player_by_name(name), 4, 0)
  30. end })
  31. minetest.register_chatcommand("question", {
  32. description = "Shows a question mark animation in a bubble",
  33. func = function(name, param)
  34. socialemote.show_emote(minetest.get_player_by_name(name), 4, 3)
  35. end })
  36. minetest.register_chatcommand("good", {
  37. description = "Shows a thumbs up animation in a bubble",
  38. func = function(name, param)
  39. socialemote.show_emote(minetest.get_player_by_name(name), 1, 0)
  40. end })
  41. minetest.register_chatcommand("bad", {
  42. description = "Shows a thumbs down animation in a bubble",
  43. func = function(name, param)
  44. socialemote.show_emote(minetest.get_player_by_name(name), 1, 3)
  45. end })
  46. minetest.register_chatcommand("idea", {
  47. description = "Shows a lightbulb animation in a bubble",
  48. func = function(name, param)
  49. socialemote.show_emote(minetest.get_player_by_name(name), 1, 9)
  50. end })
  51. minetest.register_chatcommand("sleepy", {
  52. description = "Shows a sleepy animation in a bubble",
  53. func = function(name, param)
  54. socialemote.show_emote(minetest.get_player_by_name(name), 2, 6)
  55. end })
  56. minetest.register_chatcommand("sad", {
  57. description = "Shows a black thoughts animation in a bubble",
  58. func = function(name, param)
  59. socialemote.show_emote(minetest.get_player_by_name(name), 0, 9)
  60. end })