The question/title may be weird, but it makes sense.
For example:
";speed mattangeles544444 100" -- speed will be : string.sub(1,7) -- mattangeles544444 will be: string.sub(8,18) -- 100** will be: string.sub(19,22)
If you understand, please answer, as I will be grateful.
You can use string.match()
with a capture pattern to retrieve the information from the command. For example, the command pattern might be the sequence of a semicolon, command name, player name, and numerical argument.
local testStr = ";speed mattangeles544444 100" local pattern = "^;(%w+)%s+([%w_]+)%s+(%d+)$" local command, player, arg = testStr:match(pattern)