mcer Posted December 20, 2013 Posted December 20, 2013 I want to make a player name detector, BUT with a max number of characters.
mcer Posted December 20, 2013 Author Posted December 20, 2013 string.len It can't help me, I need to set a max value.
Driggero Posted December 20, 2013 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
johny46 Posted December 21, 2013 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"
mcer Posted December 21, 2013 Author 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" Thanks!, That is what i wanted!.
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