I made a kick command for my admin commands for my game i made and it didn't work. Under line 22
local function Notify(Player,String,Code)
game.ReplicatedStorage.NotificationEvent:FireClient(Player,String,Code)
end
game.Players.PlayerAdded:Connect(function(Player)
if Player:IsFriendsWith(game.CreatorId) or Player.UserId == game.CreatorId then
wait(8)
game.ReplicatedStorage.NotificationEvent:FireClient(Player,"Welcome "..Player.Name.." you are admin. Prefix is /","E")
local prefix = "/"
Player.Chatted:Connect(function(Message)
local sub = string.sub(Message,1,1)
if sub == prefix then
local split = string.split(Message,prefix)
local lower = string.lower(split[2])
if lower == "r6" then
require(script.R6).load(Player.Name)
elseif lower == "cmds" then
Notify(Player,"Commands right now are /r6 and /reset and /lustris Note : You have to do /r6 to do /lustris","E")
elseif lower == "reset" then
Player:LoadCharacter()
elseif lower == "lustris" then
require(4758620694).load(Player.Name)
elseif lower == "kick" then
local split2 = string.split(Message," ")
if game.Players:FindFirstChild(split2[2]) and split2 ~= "all" and split2 ~= "others" then
game.Players:FindFirstChild(split2[2]):Kick("You have been kicked by "..Player.Name)
end
if string.lower(split2[2]) == "all" then
for i, v in pairs(game.Players:GetChildren()) do
v:Kick("You have been kicked by "..Player.Name)
end
elseif string.lower(split2[2]) == "others" then
for i, v in pairs(game.Players:GetChildren()) do
if v.Name ~= Player.Name then
v:Kick("You have been kicked by "..Player.Name)
end
end
end
elseif lower ~= "cmds" or lower ~= "reset" or lower ~= "lustris" or lower ~= "kick" or Message ~= nil then
require(script.Loadstring)(split[2])()
end
end
end)
end
end)

2 comments
You rock dude! I have seen you answer many questions, and they all seem right to me, I have been upvoting!
Thanks! :D