Help with /me script

I am trying to get rid of the “:” on the /me commands so it would be like "Lucifer unlocks car instead of “*Lucifer: unlocks car”

AddEventHandler(‘chatMessage’, function(source, name, msg)
sm = stringsplit(msg, " “);
if sm[1] == “/me” then
CancelEvent()
TriggerClientEvent(‘chatMessage’, -1, “^6*” … name … { 255, 0, 0 }, string.sub(msg,5))
end
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = “%s”
end
local t={} ; i=1
for str in string.gmatch(inputstr, “([^”…sep…”]+)") do
t[i] = str
i = i + 1
end
return t
end

This is what causes the “:”

You could just set nothing as the name, so it wont split them up, like this:

TriggerClientEvent(‘chatMessage’, -1, “” { 255, 0, 0 }, name..string.sub(msg,5))
(should work)

No it won’t because you forgot the , between "" and {255,0,0}


This works though:

TriggerClientEvent('chatMessage', -1, '', {255,0,0}, '^6*' .. name .. '^8' .. string.sub(msg, 4))

and looks like this:

Ah yes :stuck_out_tongue: my bad


Cheers thanks for your help :smiley:

1 Like

Thanks anyway man! Appreciate it.