mcer Posted December 20, 2013 Share Posted December 20, 2013 I want to make a player name detector, BUT with a max number of characters. Link to comment
mcer Posted December 20, 2013 Author Share Posted December 20, 2013 xXMADEXx said: string.len It can't help me, I need to set a max value. Link to comment
Driggero Posted December 20, 2013 Share Posted December 20, 2013 string.len is what you need. Detect the length of the string in question and if it is above a certain length then don't draw it Link to comment
johny46 Posted December 21, 2013 Share Posted December 21, 2013 Try this: textToDraw = string.sub(string playerName, 1, int maxCharacters) Examples: string.sub("johny46", 1, 5) == "johny" string.sub("johny46", 1, 4) == "john" string.sub("johny46", 1, 10) == "johny46" Link to comment
mcer Posted December 21, 2013 Author Share Posted December 21, 2013 johny46 said: Try this: textToDraw = string.sub(string playerName, 1, int maxCharacters) Examples: string.sub("johny46", 1, 5) == "johny" string.sub("johny46", 1, 4) == "john" string.sub("johny46", 1, 10) == "johny46" Thanks!, That is what i wanted!. 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