Is their a way to ban certain player from a part of their name?

So i trying to ban players who start their names from the word catbot_ if you can help we can take down many roblox scammer, hacke etc :wink:

1 Like

Why not something like

game.Players.PlayerAdded:Connect(function(player)
    if string.find(player.Name, "catbot_") then
        wait(1)
        player:Kick("You're banned from this game. Reason: Username is banned.")
    end
end)

I donā€™t know why youā€™d do this, all theyā€™d have to do is choose another name and itā€™d be fine.

Also, incorrect category.

4 Likes

Thanks @infiniteRaymond i will give credit for making the script btw did you but in serverscriptservice?

1 Like

Yes, put the script directly into ServerScriptService or Workspace.

Also, you donā€™t need to credit me as thatā€™s incredibly simple, lol.

1 Like

I would use a players userid because people can just change their name and be able to join again,

1 Like

The userid always changes if make a other account

He means change the name of his account with 1000 Robux

Roblox doesnā€™t give you the id of the device (ip ban) so userid is the best way or check the account age.

1 Like

Oh but nevertheless this script can olny stop this type of bot and it kind of stupid to spend that amount of rubux and get banned

best way in my opinion to stop bots it player.chatted.

1 Like

This isnā€™t suppose to be posted in Cool Creations ( nevermind, it was changed to scripting support)

1 Like

How would we stop chatting? This is a very low program bot type beacsuse they all start with Catbot_

1 Like

I also found ontheir script that can help by @varjoy this prevent links but if we could make a table that would be better or like @111122233333 we can get ip which if we could make a script to ban their ip

game.Players.PlayerAdded:Connect(function(plr)
local connections = {}
connections[plr.Nameā€¦ā€˜chatā€™] = plr.Chatted:Connect(function(chat)
if (chat) then
if (chat:lower():find(ā€œblox.pageā€) or chat:lower():find(".page")) then
plr:Kick()
end
end
end)
connections[plr.Nameā€¦ā€˜leftā€™] = game.Players.PlayerRemoving:Connect(function(p )
if (p == plr) then
for i,v in pairs(connections) do
v:Disconnect()
end
end
end)
end)