Johnniey Posted May 14, 2011 Share Posted May 14, 2011 Is there a simple script for hiding The Color tags? (# FF0000 etc.) For use in things like kill messages and chatbox output Thnx ^^ Link to comment
proracer Posted May 14, 2011 Share Posted May 14, 2011 Just an example: getPlayerName(player):gsub('#%x%x%x%x%x%x', '') Link to comment
Johnniey Posted May 14, 2011 Author Share Posted May 14, 2011 So this will change |SW|#99fff0Johnniey to |SW|Johnniey for example? Link to comment
proracer Posted May 14, 2011 Share Posted May 14, 2011 Yes for example: addEventHandler ( 'onPlayerJoin', root, function ( ) outputChatBox ( getPlayerName(source):gsub('#%x%x%x%x%x%x', ''), root, 255, 128, 0 ) end ) Link to comment
Baseplate Posted May 14, 2011 Share Posted May 14, 2011 Johniey it's too easy just go to your admin panel/resources/scoreboard resources and press settings and then search for color names and edit it from true to false Link to comment
Castillo Posted May 14, 2011 Share Posted May 14, 2011 (edited) Jesseunit, that's off-topic. This code will remove player HEX color code's from his/her nick when they change their nick or when join the server. rootElement = getRootElement() function removeHEXColor(oldNick,newNick) local name = getPlayerName(source) if newNick then name = newNick end if (string.find(name,"#%x%x%x%x%x%x")) then local name = string.gsub(name,"#%x%x%x%x%x%x","") setPlayerName(source,name) if (newNick) then cancelEvent() end end end addEventHandler("onPlayerJoin",rootElement,removeHEXColor) addEventHandler("onPlayerChangeNick",rootElement,removeHEXColor) Edited May 14, 2011 by Guest Link to comment
karlis Posted May 14, 2011 Share Posted May 14, 2011 Jesseunit, that's off-topic. so is this, and my post also. Link to comment
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