Hey again! I’m making a custom player.Chatted ban command but I want to know how I can add a custom kick message when kicking the player. For example: lua "ban PlayerName Exploiting, do not exploit.
and the kick message is lua "You have been banned. Reason: Exploiting, do not exploit.
The problem is I don’t know how to do it with what I have so far. Here is the script:
local Owner = { OwnerID = 996906122}
local prefix = ";"
game.Players.PlayerAdded:Connect(function(plr)
if plr.UserId == Owner.OwnerID then
print("Owner "..plr.Name.." has joined the game")
plr.Chatted:Connect(function(Message)
if Message:sub(1,5) == prefix.."ban " then
local Target = game.Players:FindFirstChild(Message:sub(6))
if not Target then
print("target not found")
else
Target:Kick("You have been banned. Reason: "..KickMessage)
end
end
end)
end
end)