[Release] Emojis for chat | FiveMojis 1.0

@Jakob2 Yes, you can merge the resources.
It can be done in other ways, but :peach: there you go:


Emoji + RoleFX ( or other chat resources (?) )

I don’t test it, let me know if it works

1. Copy emoji.lua in rolefx resource folder

  • Do not forget to add the file in __resource.lua as a server_script

2. Copy Emojit function in sv_chat.lua (or however is named)

function Emojit(text)
function Emojit(text)
    for i = 1, #emoji do
      for k = 1, #emoji[i][1] do
        text = string.gsub(text, emoji[i][1][k], emoji[i][2])
      end
    end
    return text
end

3. Add message = Emojit(message) before CancelEvent() in sv_chat.lua

  • Where message is the last param from your chatMessage event
Example
--                                                     |
--                                                     v
AddEventHandler('chatMessage', function(Source, Name, Msg)
    args = stringsplit(Msg, " ")
    Msg = Emojit(Msg) -- <-------------------------- HERE
    CancelEvent()
1 Like