Advertisement
Guest User

Emote module

a guest
Feb 21st, 2019
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1.  
  2. -- this module define the emotes menu
  3.  
  4. local cfg = module("cfg/emotes")
  5. local lang = vRP.lang
  6.  
  7. local emotes = cfg.emotes
  8.  
  9. local function ch_emote(player,choice)
  10. local emote = emotes[choice]
  11. if emote then
  12. vRPclient.playAnim(player,{emote[1],emote[2],emote[3]})
  13. end
  14. end
  15.  
  16. -- add emotes menu to main menu
  17.  
  18. vRP.registerMenuBuilder("main", function(add, data)
  19. local choices = {}
  20. choices[lang.emotes.title()] = {function(player, choice)
  21. -- build emotes menu
  22. local menu = {name=lang.emotes.title(),css={top="75px",header_color="rgba(0,125,255,0.75)"}}
  23. local user_id = vRP.getUserId(player)
  24.  
  25. if user_id ~= nil then
  26. -- add emotes to the emote menu
  27. for k,v in pairs(emotes) do
  28. if vRP.hasPermissions(user_id, v.permissions or {}) then
  29. menu[k] = {ch_emote}
  30. end
  31. end
  32. end
  33.  
  34. -- clear current emotes
  35. menu[lang.emotes.clear.title()] = {function(player,choice)
  36. vRPclient.stopAnim(player,{true}) -- upper
  37. vRPclient.stopAnim(player,{false}) -- full
  38. end, lang.emotes.clear.description()}
  39.  
  40. vRP.openMenu(player,menu)
  41. end}
  42. add(choices)
  43. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement