I am trying to make several chatcommands in my new server modification for Crysis Wars that requires numbers and strings. To get the player input, I do this:
local name, time, reason = string.match(chatMsg, "^!punish (.*) (%d+) (.*)");
For some reason, it's not working properly (gets the number value as a string). The number value is the second variable in the string.match. Am I doing something wrong here? I've also tried to find a solution to this, but have not found any. Perhaps I should be using a different method to get the number?
tonumbertakes (up to) two arguments, and the second must be a number type, whilestring.matchreturns as many string values as captures in the pattern; Like I wrote in my answer, add the line.