client:
RegisterNetEvent('EventName') AddEventHandler('EventName', function() TriggerEvent("chatMessage", "Sender Name", {150, 50, 180}, "text to send") end)
server:
AddEventHandler('chatMessage', function(player, playerName, message) if message:sub(1) == '/test' then TriggerClientEvent('EventName', player) CancelEvent() end end)
Edit for your liking I also believe this has all you need