How to change color of chat text

So the color of my team is white, & so the whole thing is white straight across for that team is there a place i can find out where to change the coding for the chat text just to make it a slightly light grey? Btw this is for deathrun.

-snip- stupid

I already have a new team color. & how would i go about making a custom chat box?

Do you need a really really custom chat box or do you just need one that looks cool?

I need one that will simply make the name white, but what they actually say light gray, Just so you can tell the difference. Is there really no way to change the default color in a lua file? I already have a white name, But what they say needs to be a light gray, that’s all.

What gamemode are you using?


Can you textsearch for OnPlayerChat in the deathrun files, and give us that function if you find it?

You don’t need custom chatbox for custom colors, you can simply use OnPlayerChat hook.

I cant seem to find it. Is there a specific folder you can lead me to, or can i make one myself? All i found was hook_examples.lua would that help at all?

-snip this has nothing to do with what he wants-

What the fuck are you doing?

function GM:OnPlayerChat( ply, strText, bTeamOnly, bPlayerIsDead )
	-- I've made this all look more complicated than it is. Here's the easy version
	-- chat.AddText( ply:GetName(), Color( 255, 255, 255 ), ": ", strText )
	local tab = {}
	if ( bPlayerIsDead ) then
		table.insert( tab, Color( 255, 30, 40 ) )
		table.insert( tab, "*DEAD* " )
	if ( bTeamOnly ) then
		table.insert( tab, Color( 30, 160, 40 ) )
		table.insert( tab, "(TEAM) " )
	if ( IsValid( ply ) ) then
		table.insert( tab, ply:GetName() )
		table.insert( tab, "Console" )
	table.insert( tab, Color( 255, 255, 255 ) )
	table.insert( tab, ": "..strText )
	chat.AddText( unpack(tab) )
	return true

Change all the colors you want, put this into cl_init.lua of your gamemode. If needed, convert it into a hook.

Robot boy, your works nearly completely. It changed the color of the text, but it made both runners & deaths name a light blue when they type. Is there anyway i can keep those at the original color name when typing, but still have the different colored text? Thanks!

replace ply:GetName() to ply

Thank you all, it worked! All i did was change the “ply:getname ()” to just “ply” (without quotations). & it worked! Well, i also deleted the bteam part, only because i didn’t need can anyone instruct me on how to mark this as solved?

At the top of the OP should be a link to do so