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

How do you fix walk speed anti exploit glitching?

Asked by 5 years ago

Hello,

I reposted this question because I didn't get an answer to my problem within 3 days.

Context: - I have been designing an anti exploit for my game.

Problem: - Due to Roblox physics, in the walk speed check of the anti exploit, it is possible for a player to be propelled to a velcoity above their walk speed value. For example, when the player bounces of a part and goes beyond the speed of their walk speed, the anti exploit kills them. We obviously don't want this.

Attempted solutions: - I didn't know how to fix this issue with my current code. However, further up in my code, I made a way to turn off the anti exploit by command. I know this is not preferable as exploiters could find a way to duplicate this command. I added +1 as it allows some extra room for the player to be propelled slightly above their walk speed. For example, this would stop players from being killed once they hit a corner of a wall. However, this is not a fix.

Current code: - Here is the current code for the walk speed section of my anti exploit. This is in a local script:

local hum = char:WaitForChild("Humanoid")
hum.Running:Connect(function(speed)
    if hum ~= nil then
        if speed > hum.WalkSpeed then
            hum.Health = 0
        end
    end
end)

Other anti exploits: - I am new to Roblox anti exploit scripting. So, I'm not sure how to script this kind of code, so I'm using Roblox tutorials and Reddit for support. Obviously, this is not preferable. Therefore, if you have any suggestions on other anti exploit scripts to detect for player changes that would be great. At the moment, I am detecting for BodyPosition, BodyVelocity and BodyGyro additions to the character (to check for fly), HopperBin additions in the backpack (to check for btools), removing a humanoid (checking for god), and the glitchy walk speed check (the code above).

Any advice or solutions you may have would be appreciated.

Tweakified

1 answer

Log in to vote
1
Answered by 5 years ago

It isn't really recommended to use local scripts for anti-exploits. Exploiters can easily modify and/or disable your script. The best thing to do is make your game Filtering Enabled and never trust the client.

There was a discussion I read a while back. I suggest you take a look: https://devforum.roblox.com/t/how-to-prevent-speed-hacking/210733

Theoretical Solution

I think you can check the Humanoid's current HumanoidStateType to determine if they are Running and/or FallingDown, then if is Running check the Speed/Velocity of the Humanoid to see if it is overkilling it.

https://developer.roblox.com/api-reference/enum/HumanoidStateType

Good luck.

0
Thanks, I knew about HumanoidStateType, but I didn't know it could be used like this. Thanks for your support. Tweakified 117 — 5y
Ad

Answer this question