Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Serversided anti cheat does not function for some reason?

Asked by 3 years ago
Edited 3 years ago

I have an anti cheat where it catches a player tping, flying, FE, etc. etc. however it seems like it does not work. The script is not disabled and if I put in "print("test") it for some reason works. This script is inside ServerScriptService since local scripts can be bypassed so easy

local Players = game:GetService("Players")
game.Players.PlayerAdded:connect(function(player)
    print("test")
    local Character = player.Character
    local Backpack = player:WaitForChild("Backpack")
    local HumanoidRootPart = player:WaitForChild("HumanoidRootPart")
    local Bodys = {
        ["BodyGyro"] = true,
        ["BodyVelocity"] = true,
        ["BodyPosition"] = true
    }


    local function Kick()
        player:Kick("Caught by AntiGamingChair")
    end
    -->>:Anti TP
    local function CheckTeleport()
        if HumanoidRootPart == nil then
            return Kick()
        end

        local PositionFirst = HumanoidRootPart.Position

        delay(1, function()
            local PositionSecond = HumanoidRootPart.Position

            if (PositionSecond - PositionFirst).magnitude >= 130 then
                return Kick()
            end
        end)
    end

    -->>:Anti BTools
    Backpack.ChildAdded:connect(function(Obj)
        if Obj:IsA("HopperBin") then
            return Kick()
        end
    end)

    -->>: Anti fly
    HumanoidRootPart.ChildAdded:connect(function(Obj)
        if Bodys[Obj.ClassName] then
            return Kick()
        end
    end)

    -->>: Anti godmode
    Character.ChildRemoved:connect(function(Obj)
        if Obj:IsA("Humanoid") then
            return Kick()
        end
    end)

    while wait() do
        CheckTeleport()
    end
end)
0
You call functions by doing "someFunction()", not "return someFunction()". In addition, you can't return anything from a function that is connected to an event, because when the event is fired, the Roblox engine calls the function internally and simply ignores any value that the function returns. OfficerBrah 494 — 3y
0
Something like this seems like a really bad idea anyways. Exploiters can only do things to their own client if FilteringEnabled is on (I believe it's enforced everywhere now). For example, this script will kick someone if they lag for too long or take off a clothing item (or if another script does it).  OfficerBrah 494 — 3y
0
Even though a lot of developers say to not make anti-exploits on the client, I'd highly suggest that because 90% of the exploiters use admin scripts, if you merge the anti exploit with your main localscript or blend it with multiple, it would give the exploiter a hard time to find and modify the script with a dex. greatneil80 2647 — 3y
View all comments (7 more)
0
Good to know, I tried it in studio earlier and it didn't work but I must have done something different. I didn't think about the possibility of this being implemented into an admin script, but the script would have to be a lot more thought out than this, because at the moment, this will kick a lot of legit players and very few exploiters OfficerBrah 494 — 3y
0
I disagree with that statement about the client, regardless of how “difficult” it is to find, once the vulnerability is there it’s there. check out this thread. https://devforum.roblox.com/t/how-could-i-go-about-making-a-random-password-for-remote-events-for-security-against-exploiters/113386/5 Speedmask 661 — 3y
0
that thread is not completely related, but still. obfuscation just by having multiple client scripts is not the way to go. you can make it easier on yourself with client anticheat, but you can’t expect a catch-all unless you just find it way too hard to make it in a serverscript and can’t be bothered. Speedmask 661 — 3y
1
Patching the vulnerability is necessary but having a client sided anti exploit can further prevent small exploiters that can't read code. For big developers, they might bypass it but they will have trouble and the chances of them giving up are slightly larger. I'm not saying you can 100% get rid of all exploiters, I am saying that you can get rid of the majority. greatneil80 2647 — 3y
0
well, I am not aware how organized that community is but as far as I know it will only take one developer worth their salt to dole it out to the average user. it seems like a bit of a grey area. although I thought it might be a waste of time but it did make me think Speedmask 661 — 3y
0
provided it’s easy enough to make a client script, that’s even more time wasted for the opposite side. you can only do that so many times, though... and you might even inadvertently end up relying on it and neglecting the real, server solution. not to mention these are already rendered useless for those already solved by the server. Speedmask 661 — 3y
0
Think about it this way, would you rather have more security in a game but spend more time building the code which can impact likes, players and gamepass sales, or less security in a game with more exploiters which can lead others to rage quitting? greatneil80 2647 — 3y

Answer this question