:Split Arguments

How can make a spit capture multiple arguments rather just a space? Since I was making an admin panel and usually the space wat the split, but I’m making a message system where I want the command split to capture the ENTIRE message which is multiple arguments.

local SplitCommand = Command:split(" ")

I’m confused as to what you mean. Do you mean splitting at every character Command:Split("")? Or do you mean just leaving the entire message Command?

I’m not sure what exactly you’re trying to explain here, but I might know what you want to achieve.

Do you want a table to return every argument starting from a certain index as one string?


-- where arguments is {"player", "This", "is", "a", "test"}

local player = findPlayer(arguments[1])
local reason = arguments[2] -- you want it to return "This is a test" instead of "This"?

if player then player:Kick(reason) end

I want the split to basically split into more than the 3rd argument. The entire message.

local SplitCommand = Command:split(" ")
SplitCommand[3] == “:kill” or SplitCommand[3] == “:Kill”

I just want it where the :split will capture an entire message instead of the 3rd argument.

local SplitCommand = Command:split(" ")
SplitCommand[3] == “:kill” or SplitCommand[3] == “:Kill”

So don’t split it? I’m really not sure what you mean.

I’m trying to make a :split capture a ENTIRE message. How can I do that, if you can’t how can I make when you type :kill in the chat the 3rd part of the message is the reason. Where how can I make the reason work without a split.

ohhhh I see, you could use it with parentheses. An example is when I made a kick command, when using in the chat it would be /kick playerName (reason). If you want to know how to do that, it’s in this video I made:

Hello. Could you explain this part of code in your video? Also how could I make it where you don’t need a parenthesis?

local Reason = string.sub(string.split(Command, '(')[2], 1, -2)