Jump to content

(Chat)constant color


eoLShady

Recommended Posts

addEventHandler( "onPlayerChat", root, function( msg, ch )
	cancelEvent() -- disable default chat and run our code instead.
	if ch == 0 then
		local newMsg = string.gsub(msg, '#%x%x%x%x%x%x', '') -- remove color codes from message
		local newName = string.gsub(getPlayerName(source), '#%x%x%x%x%x%x', '')-- remove color codes from name
		outputChatBox( newName..': '..newMsg, root, 255, 255, 525)
	end
end )

 

  • Like 1
Link to comment
6 hours ago, Mr.Loki said:

addEventHandler( "onPlayerChat", root, function( msg, ch )
	cancelEvent() -- disable default chat and run our code instead.
	if ch == 0 then
		local newMsg = string.gsub(msg, '#%x%x%x%x%x%x', '') -- remove color codes from message
		local newName = string.gsub(getPlayerName(source), '#%x%x%x%x%x%x', '')-- remove color codes from name
		outputChatBox( newName..': '..newMsg, root, 255, 255, 525)
	end
end )

 

Thanks 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...