Jump to content

(Chat)constant color


eoLShady

Recommended Posts

Posted

Hello Guys,Different colored names appear when typing in chat,They write the color code next to the name in the settings section,how can we make it fixed color...
fixed color code : #FFFFFF
I want everyone to color code automatically like this,Could you help.

Posted
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
Posted
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 

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...