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.
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)
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 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
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.