local Commands = {
kick = "kick "
}
local Prefix = "!"
game.Players.PlayerAdded:Connect(function(players)
players.Chatted:Connect(function(message)
for i,v in pairs(Owner) do
if v == players.UserId then
for i,v in pairs(game.Players:GetChildren()) do
if message == Prefix..Commands.kick..v.Name then
v:Kick("Test")
end
end
end
end
end)
end)
local function autofill(abbreviation) -- autofills player name
for i,v in ipairs(game:GetService("Players"):GetPlayers()) do
if v.Name:lower():sub(1,abbreviation:len()) == abbreviation:lower() then
return v
end
end
end
local Commands = { -- commands
kick = "kick"
}
local prefix = "!" -- prefix
game.Players.PlayerAdded:Connect(function(plr) -- getplayer
plr.Chatted:Connect(function(message) -- chatted
local split = string.split(message," ") -- splits the message by spaces
if string.lower(split[1]) == prefix..Commands.kick then -- checks for command
local player = autofill(split[2]) -- gets player
if player then
local reason = split[3] -- reason
if not reason then reason = "Unknown" end -- if there isnt any reason the reason becomes Unknown... literally
player:Kick(reason) -- kick
end
end
end)
end)