Anti Cheat for Beginner Developers

After reviewing the code, it looks messy (for the ban system)

game:GetService("Players").PlayerAdded:Connect(function(Player)
    if Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "Atem_Pharaoh1735" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" then
        Player.CharacterAdded:Connect(function(Character)
            --credits to Ron_GM(Kayaba) for helping
            while wait(1) do
                if Character:FindFirstChildOfClass("Humanoid").WalkSpeed > 40 or Character:FindFirstChildOfClass("Humanoid").JumpPower > 50 then
                    Player:Kick("You know why. Stupid.")
                    break
                end
            end
        end)
    end
end)

I recommend you use this code provided by @BankrollAbd

Player.CharacterAdded:Connect(function(Character)
            --credits to Ron_GM(Kayaba) for helping
            while wait(1) do
                if Character:FindFirstChildOfClass("Humanoid").WalkSpeed > 40 or Character:FindFirstChildOfClass("Humanoid").JumpPower > 50 then
                    Player:Kick("You know why. Stupid.")
                    break
                end
            end
        end)

Also, as everyone said:

@hrxin Since you’re anti-cheat is SS, and the code you provided can’t do anything it’s rendered useless.

Here is what I mean (if you don’t understand what my point is.)

1 Like

You can use my EZban module to ban people. Link to the post here: EZban ~ ban users without a hassle! - Resources / Community Resources - DevForum | Roblox

@BankrollAbd’s code encourages banning users by username, which is bad because you can change your name to bypass it. UserIds should be the only banning method. @Jermartynojm’s code should be used.

Then at that point you might as well not be using your method anyway, since you’d only be using UserIds and Jermartynojm’s code does that in a simpler way.

Why don’t you just use Find like I did. No need to loop through table.

i find using a function to detect it way better than table.find

Ok these are just your preferences. Do as you want in your code.

I tested it I am not dumb, It won’t ban entire server.

No they won’t I tested it trust me, try it.

1 Like

The version that I have seen would ban everyone except banned people. We do not know how does your script works for you. You probably haven’t tested it even when you say so (or maybe you tested it changing the speed on the server instead of the client).

If you still want to use the version of the script you have now, at least kick players who are banned, like this:

game:GetService("Players").PlayerAdded:Connect(function(Player)
	if Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "Atem_Pharaoh1735" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" and Player.Name ~= "BannedPersonNameHere" then
        --[[Player.CharacterAdded:Connect(function(Character)
            --credits to Ron_GM(Kayaba) for helping
            while wait(1) do
                if Character:FindFirstChildOfClass("Humanoid").WalkSpeed > 40 or Character:FindFirstChildOfClass("Humanoid").JumpPower > 50 then
                    Player:Kick("You know why. Stupid.")
                    break
                end
            end
        end)]]
		--Will not work as exploiters change their speed locally and locally changed speed is not replicated to the server.
	else
		Player:Kick("You are banned!")
	end
end)

If I were you, I would use this script instead:

Test it with a localscript that changes the player’s walkspeed, you will notice that the player is not kicked.

what i know is exploiters use client sided

Use a table, please dont use 90 or.

Yes, exploit script executors are client sided.

Please read my post before replying. :arrow_up:

the only way we make an anticheat is using magnitude and cframe

Using the .WalkSpeed to detect speed exploits it’s actually useless, a better check-system would be checking the studs that the server-walk speed can move in a second and if the player moves more than these studs in a second the script should teleport him back to the last good position.

1 Like