i already started on this but theres one problem
my “reason” will only take the third argument so if theres a space in the reason it wont work
--Admin Script
plr.Chatted:Connect(function(msg)
local loweredString = string.lower(msg)
local args = string.split(loweredString," ")
if args[1] == prefix..'kick' then
adminmodule.Kick(args[2], args[3])
end
end)
--Module
function admin.Kick(player, reason)
for i,players in pairs(game.Players:GetPlayers()) do
if string.sub(string.lower(players.Name), 1, string.len(player)) == string.lower(player) then
players:Kick(reason)
else
print('player not found')
end
end
end
local args = string.split(loweredString, " ")
if args[1] == prefix..'kick' then
adminmodule.Kick(args[2], table.concat(args, " ", 3)) -- args being the array, " " being the separator (whitespace), and 3 being the starting index of the array (args[3])
end