i tried to change the format of the ban message like trying such as avoiding socials name or things like that, but it return tags for something like “test test test”
Currently working on my team, i’m assigned on working on a ban command for the game i’m working on. As you can see the screenshoot and script below, my script is working but i don’t have any way to prevent the ban to occur when the message could be tagged, i would hope something like check if the message is tagged or not then ban player.
-- for _,command in game.TextChatService.Admin:GetChildren() do
if command:IsA("TextChatCommand") then
command.Triggered:Connect(function(playeri,message)
if command.Name == "Ban" then
local player = game.Players:FindFirstChild(playeri.Name)
if player and player.UserId then
if table.find(allowedids,player.UserId) or player:GetRankInGroup(7936983) >= allowed then
local args = message:split(" ")
if args[2] and args[3] then
local target = args[2]
local reason = table.concat(args," ",3,#args)
local targetplayer = game.Players:FindFirstChild(target)
if targetplayer then
local config: BanConfigType = {
UserIds = { targetplayer.UserId },
Duration = -1, -- Nah i think its enough
DisplayReason = 'You have been permanently banned by '..player.Name.. " for the following reason :( "..reason.." ), You can always contact us if you think the ban was not fair on our socials with a proof.", -- Reason that will show up
PrivateReason = "Player banned by "..player.Name.. " UserId:"..player.UserId.. " For reason: "..reason,
ExcludeAltAccounts = false,
ApplyToUniverse = true
}
game.Players:BanAsync(config)
end
end
end
end
end
end)
end
end
my best guess is “You can always contact us if you think the ban was not fair on our socials with a proof.” is the part causing issues because it’s asking for people to go off-platform.
also kind of silly how the ban message the person sees gets censored when it contains very useful information about why they got banned, so they don’t even know what they got banned for most of the time
i would rephrase the last part to " You can be unbanned by submitting proper proof." because it gets the point across that you can appeal your bans in the server without actually saying it
After some Anti Ban, Anti kick exploits prevention, i’m still struggling on how to prevent the ‘reason’ part to be tagged
if command.Name == "Ban" then
local player = game.Players:FindFirstChild(playeri.Name)
if player and player.UserId then
if table.find(allowedids,player.UserId) or player:GetRankInGroup(7936983) >= allowed then
local args = message:split(" ")
if args[2] and args[3] then
local target = args[2]
local reason = table.concat(args," ",3,#args)
local targetplayer = game.Players:FindFirstChild(target)
if targetplayer then
targetplayer:Kick(":(")
task.wait(1)
local success,errorm = pcall(function()
local config: BanConfigType = {
UserIds = { targetplayer.UserId },
Duration = -1, -- Nah i think its enough
DisplayReason = 'You have been permanently banned by '..player.Name.. " for the following reason : ( "..reason.." ), You can always be unbanned from submiting proper proofs.", -- Reason that will show up
PrivateReason = "Player banned by "..player.Name.. " UserId:"..player.UserId.. " For reason: "..reason,
ExcludeAltAccounts = false,
ApplyToUniverse = true
}
game.Players:BanAsync(config)
end)
if errorm then
warn(errorm)
local cheater = game.Players:FindFirstChild(target)
if cheater then
cheater:Destroy()
end
end
task.wait(2)
local cheater = game.Players:FindFirstChild(target)
if cheater then
cheater:Destroy()
end
end
end
end
end
You could test beforehand if the text is going to be filtered with TextService:FilterTextAsync (e.g. give the mod a preview of what the ban text will look like).
Other than that, text filtering is forced to run on the message’s text, so there isn’t a way around this.