[DMC] Posted October 23, 2010 Share Posted October 23, 2010 hey, i made 2 edits with name and text colors but how can i make it just HEX and not any text Link to comment
CowTurbo Posted October 23, 2010 Share Posted October 23, 2010 what you mean ? maybe setPlayerNametagText .. ? Link to comment
[DMC] Posted October 23, 2010 Author Share Posted October 23, 2010 no example , my name is DMC when i type in the edit and i type lolololol it wil make my name lololololdmc but i want just hex and nothing else so i only can type a hex code in there Link to comment
dzek (varez) Posted October 23, 2010 Share Posted October 23, 2010 function isColorCode(str) if (string.find(str, "^#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$")) return true return false end function isContainingColorCode(str) if (string.find(str, "#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]")) return true return false end function isBeginningWithColorCode(str) if (string.find(str, "^#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]")) return true return false end examples: isColorCode("#ff00ff is cool color") -- false isColorCode("#ff0000") -- true isColorCode("i like this color: #00ff00") -- false isContainingColorCode("#ff00ff is cool color") -- true isContainingColorCode("#ff0000") -- true isContainingColorCode("i like this color: #00ff00") -- true isBeginningWithColorCode("#ff00ff is cool color") -- true isBeginningWithColorCode("#ff0000") -- true isBeginningWithColorCode("i like this color: #00ff00") -- false btw: i have written this thing, but not tested it Link to comment
[DMC] Posted October 23, 2010 Author Share Posted October 23, 2010 Ok ty varez i needed this 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