eoLShady Posted September 20, 2020 Posted September 20, 2020 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.
Mr.Loki Posted September 23, 2020 Posted September 23, 2020 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 ) 1
eoLShady Posted September 23, 2020 Author Posted September 23, 2020 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now