Hello there Robloxians!
Now, some of your games may need protection, and for example, if you don’t like someone, you can just kick them when they join a game!
I present to you…
Crrustban!!
Yes, these scripts kick players from your game, if they have a specific name, id or account age.
1) Account name
Alright, you wanna ban someone if they have a certain name? Well, follow me!
So, first thing you wanna do is insert a Script
into ServerScriptService
and call it whatever you want, like Name for example. Now, you want to create a list of the names you want to keep out, so let’s do that!
local bannedNames = {
"Crrustyy",
"MightyBloxMason",
"Builderman"
}
These names can be whatever you want them to be, whoever you wanna keep out.
We can also write a pre-written message, like this:
local message = "Sorry, you aren't allowed here!"
This will popup when it kicks them.
Now, we want to check if a player has these names, so we write:
game.Players.PlayerAdded:Connect(function(playerJoined)
for i, v in pairs(bannedNames) do
if player.Name == v then
player:Kick(message) -- Kicking them, whilst showing the message
end
end
end)
Well, that basically kicks them if they have a certain name, but what if they change their name? You may want it to kick them no matter what if they change their name or not. So, moving on to
2) UserId Banning
So, again, this will involve a Script
in ServerScriptService
, and including the following,
local bannedID = {
1268610732, -- Me
205576167, -- MightyBloxMason
1 -- Roblox
}
We can also include the message,
local message = "Sorry, you aren't allowed in here!"
We can now link this when the player joins the game!
game.Players.PlayerAdded:Connect(function(playerWhoJoined)
for i,v in pairs(bannedID) do
if playerWhoJoined.UserId == v then
playerWhoJoined:Kick(message)
end
end
end)
This is more efficient than the player’s name, since they cannot change their ID.
But what if you wanted to kick them based on their account age? You don’t want bots in, do you? Alts? No, I wouldn’t
Account age scripts are found in the model
Well, that is all there is to it! Change the Names, ID's and the account age
to what you think feels right!
Here is the model for Crrustban:
https://www.roblox.com/catalog/5065544805/Crrustban
Feel free to reply with anything you want to add on, if there Is a better way of doing it, or just your views on it!
Many thanks,
Crrustyy