Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Development authored Mar 14, 2024
1 parent 7eb12eb commit a9deed0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Config = {
emojis = {
[":dog:"] = "๐Ÿถ",
[":cat:"] = "๐Ÿฑ",
[":mouse:"] = "๐Ÿญ",
[":hamster:"] = "๐Ÿน",
[":rabbit:"] = "๐Ÿฐ",
[":fox:"] = "๐ŸฆŠ",
[":bear:"] = "๐Ÿป",
[":panda:"] = "๐Ÿผ",
[":koala:"] = "๐Ÿจ",
[":tiger:"] = "๐Ÿฏ",
[":lion:"] = "๐Ÿฆ",
[":cow:"] = "๐Ÿฎ",
[":frog:"] = "๐Ÿธ",
[":monkey:"] = "๐Ÿต",
}
}
11 changes: 11 additions & 0 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fx_version 'cerulean'
games { 'gta5' }
author 'JoeV2'
description 'A Script to convert prefix in chat to a emojie'
version '1.0.0'


server_scripts {
'config.lua',
'server.lua'
}
12 changes: 12 additions & 0 deletions server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local function SanString(message)
for emoji, replacement in pairs(Config.emojies) do
message = message:gsub(emoji, replacement)
end
return message
end

AddEventHandler('chatMessage', function(source, name, message)
local sanitizedMessage = SanString(message)
TriggerClientEvent('chatMessage', -1, name, { 255, 255, 255 }, sanitizedMessage)
CancelEvent()
end)

0 comments on commit a9deed0

Please sign in to comment.