So I'm making customizable admin commands for players to take and edit but I want to make sure that their own custom made commands should work the way they should work.
The problem is I need to identify certain words in a string and cut them apart. It should look like something like this:
local Command = "/kick everyone"
function slice()
-- do function stuff
return "kick", "everyone"
end
function process(command, Player)
local cmd, quantity = slice(command)
if quantity = "everyone" then
return game.Players:GetPlayers()
elseif quantity = "self" then
return Player
elseif quantity = "others" then
local PlayersTable = {}
for i,v in pairs(game.Players:GetPlayers()) do
if v ~= Player then
table.insert(PlayersTable, v)
end
end
end
end
I never really spent time learning all the string functions but it's really complicated for me to understand it all. A bunch of other admin commands do this to shorten up time it takes to execute each admin command.
It should figure out to ignore the admin prefix and separate the command from the "player quantity" but I'm very confused and I need ideas.

2 comments
Realised later you can also use word:split(“ “) which gives you the table directly
content:split(“ “)