Hello fine developers,
I’m currently making my own admin system, and I’ve just started out with a warn command. I’m currently using string.split with a space inbetween the quotes to split the player’s message. But of course, the reason which could be long would normally have spaces, so what would I do?
Here is the script (supposedly in a ModuleScript):
local adminCommands = {
warnCommand = function(author, message)
local player = game.Players:FindFirstChild(author);
if player then
local IsAdmin = player.Character:FindFirstChild("IsAdmin");
if IsAdmin then
if IsAdmin.Value == true then
local rankCount = player.Character:FindFirstChild("Rank");
if rankCount.Value >= configSettings.modCommands.Warn.Requirement then
if message:sub(1, #";warn"):lower() == ";warn" then
local args = message:split(" ")
local playerToWarn = game.Players:FindFirstChild(args[2])
if playerToWarn then
local warnMessage = args[3]
end
end
end
end
end
end
end
}
The problem here is that I don’t know how I’ll join back the reason part into one string, or I don’t know how I"ll found out how long the words are which are split by a space.
This is currently what I’m trying to do:
:warn <player> <reason>