Anti Walkspeed, Client Side

I’ve done an anti walkspeed etc client side, (Local Character script) but apparently that is easy to bypass so i was thinking about making a server sided one.

Could i do something similair to this;
Make a table of all the players, from game.Players for loop.
Then run through the player names in workspace to find them, and check for walkspeed has boosted etc and jump power?

Or would this just be a waste of time, as i need an anti cheat to stop users picking up items too quickly and speeding/tping to them.

An easy way to detect speed hacking is to check how far a player moved in 1 second. If they’re moving more than X studs in 1 second but your walkspeed is significantly less than X studs they’re either extremely laggy or teleporting / speed hacking.

BTW this detection is meant to be used on the server.

You should still implement checks on the client and fire a remote event because it will catch elementary exploiters who don’t know what they’re doing.

There’s a post out there called exploiting explained.

The poster has said that referencing Walkspeed can easily be bypassed.

I may be wrong, but server sided checks to humanoid walkspeed reference client side values.

However, you could implement as @ vtaetwrjxvdpgwjqkfzw mentioned random checks to how far a player has moved. I’m not sure if you want to do this every frame, since it might lag.

1 Like

Yeah this could be a valid method but for laggy users, getting kicked/banned would be a bit far for someone lagging

I think a game called “Isle” implemented this:

They teleport you to your original location if the magnitude check is too high. So it’s a compromise between not doing anything and kicking users.

1 Like

Actually you could use the :GetPropertyChangedSignal(“Position”) in the HumanoidRootPart.
To do this you would need something like that:

-- This is in the case you are doing in the server which is more secure
game.Players.PlayerAdded:Connect(function(player)
      player.CharacterAdded:Connect(function(char)
           --Get the important infos such as the original position of the root part and a time
           local humRoot = char:WaitForChild("HumanoidRootPart")
           local thePosition = humRoot.Position
           local myTime = tick()
           -- Update the important infos (I am using wait(1) because thats when my distance limitation stops checking on the position)
           coroutine.wrap(function()
                 while wait(1) do
                      thePosition = humRoot.Position
                      myTime = tick()
                 end
           end)()
           --Use this method to fire a function when the specified property changes
           humRoot:GetPropertyChangedSignal("Position"):Connect(function()
                  -- The time thing is a extra that detects whenever this change happens in less than the time you let this happen, If you dont really need that then you can ignore the tick() and myTime.
                  if (humRoot.Position - thePosition).Magnitude >= 100 and (myTime - tick()) < 1  then
                        --After checking the distance between the positions (I put a maximum distance of 100) you will set the position and time variables to the new ones.
                       
                        humRoot.Position = thePosition
                        --Putting a player back to the location they were before
                        thePosition = humRoot.Position
                        -- Variable for the old position updates to the new position
                        myTime = tick()
                        
                  end
           end)
      end)
end)
2 Likes

Players setting there own walk speed replicates to the server so just use a player added event then a function that runs every frame that checks if the walk speed is over the normal amount

It doesn’t replicate to the server - otherwise so might Health or NameDisplayDistance.

The functionality is as if it were replicated with WalkSpeed, though, because the client handles its own position, not the server.

It has to replicate to the server if it doesn’t Roblox would break down, your characters position thousands of studs away from the servers view it wouldn’t work

That’s also why exploiters can teleport

You have physics control over your character, so your HumanoidRootPart’s CFrame replicates to the server.

You can do a test right now, print the players walkspeed every frame and see if changing it on the client changes it on the server.

I would do a test but I cant (30 charssssssssssssssssss)

1 Like

This isn’t how replication works on Roblox.

Roblox gives physics ownership to unanchored parts that are near (or are) the character.

The actual property for WalkSpeed just tells the client script what walkspeed to run the player with - it doesn’t replicate from Client → Server.

I have developed a test place for you.

If you visit, you can see that when you update the client’s local walkspeed it doesn’t change the server walkspeed.

That won’t work because of how physics work in-game.

1 Like

Making checks on the client can easily be bypassed.
What is actually replicated is their position (it is automatically sent to the server), not the walkspeed property itself.

You could check how far they travel within X amount of seconds on the server.

if (LastCheck - NewCheck).Magnitude >= some_number then
-- perhaps teleport them back?
-- Kicking someone that might lag would not be very efficient.
end

You can use the HumanoidRootPart’s position to check this.
Simply wrap this in a while loop and check it.