Hello, I'm totally newbie, and I'm learning LUA with making Role Play server. For the first, sorry for my bad English, please, be forgiving.  
I have got a local chat, for the aesthetics I want to manipulate chars in var. Example, player press t (open chat) and write -> "hello, I'm new in the town", when he press enter in the chatbox there is a "Hello, I'm, new in the town." (capital letter and dot in the end). I hope you understand my request. I don't want ready script (if you want...), I look forward to tips. 
My localchat function... 
  
function sendMessageToNearbyPlayers( message, messageType ) 
    if messageType == 0 then 
        local posX, posY, posZ = getElementPosition( source ) 
  
        local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) 
        local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) 
        destroyElement( chatSphere ) 
        local gracz = getPlayerName (source) 
        local dlugosc = #message 
        for index, nearbyPlayer in ipairs( nearbyPlayers ) do 
            if dlugosc <= 8 then 
            outputChatBox( "#99b7d0" .. gracz .. " mówi: #c8e6ff" .. message .. "", nearbyPlayer,255,255,255,true ) 
            setPedAnimation( source, "ped", "IDLE_chat", #message*70, false, false, false, false) 
            else 
            outputChatBox( "#99b7d0" .. gracz .. " mówi: #c8e6ff" .. message .. "", nearbyPlayer,255,255,255,true ) 
            setPedAnimation( source, "ped", "IDLE_chat", #message*35, false, false, false, false) 
            end 
        end 
    end 
end