I’m trying to get an anti-exploit for my game but this one is not working it is a script inside ServerScriptService. How would I fix this script to make it work?
if player.Humanoid.WalkSpeed >= 18 then
player:Kick("Exploiting")
end
I’m trying to get an anti-exploit for my game but this one is not working it is a script inside ServerScriptService. How would I fix this script to make it work?
if player.Humanoid.WalkSpeed >= 18 then
player:Kick("Exploiting")
end
It will not do anything to prevent exploiters because they change WalkSpeed
on the CLIENT
Basically, when the CLIENT changes a property, it will not replicate to the server due to FilteringEnabled.
The script will not catch if the CLIENT locally changes the walkspeed
Well one of the ways you could check Humanoids walkspeed would to check how far it went over a period of time. For example:
local MaxSpeed = 18
local char = game.Workspace:FindFirstChild("player name")
local pos1 = char.HumanoidRootPart.Position
delay(0.95,function()
local pos2 = char.HumanoidRootPart.Position
local velocity = (pos1-pos2).magnitude
if velocity > MaxSpeed+3 then
print("speed hacking")
end
end)
If you making a anti-speed exploit you need to make in starterplayer and a local script because they changing speed in client
Doing so won’t stop exploits because they can edit and delete all local scripts. If you want to stop them make a Server Script in ServerScriptService.
Would that script that I have in my post work if I put it in a localscript and put it in startplayer?
I know they could delete it but its better then nothing and I don’t know how to make a anti exploit so even if I have a basic one its still better then if I didn’t have one at all
If you use it in a local script then yes it will work fine but its not recommended due to being bypassable by deleting the script itself.
They can. Trust me. I’m a Developer at Northern Shield and we’ve been battling exploits for I while. I’ve made some client sided ones and they’ve ben easily bypassed by deleting the local script and its just known as a possibility. Now you may get skids who do not know how to script and use some easy free scripts but that will be all as most actual exploiters will look for anti-cheats.
You can detect if they delete the script with a server-side script
Exploiters cannot touch server scripts. Its local scripts they can do whatever with.
but we can check if they changed the script
No because they will delete that script too. Trust me I had a normal script then a second copy script to see if they deleted it locally and you can’t check if they delete a local script from a server script. Trust me it is 10 times harder to stop exploits than it may seem.
I just tried doing that but It doesn’t work still.
If you put a copy of the local script in server storage and copy it over every like 5 seconds, if the script no longer exists, you could properbly detect if it is deleted multiple times, and if so, kick the player or whatever.
for example:
local players = game.Players
local localScript = game.ServerStorage.AntiSpeed
players.PlayerAdded:Connect(function(plr)
local antiSpeed = localScript:Clone(); antiSpeed.Parent = plr.PlayersScripts
wait(3)
local x = 0
while true do
if not plr.PlayerScripts.AntiSpeed then
local antiSpeed = localScript:Clone(); antiSpeed.Parent = plr.PlayersScripts
x = x+1
if x > 1 then
plr:kick("Suspicous Activity")
end
wait(3)
end
end)
This might work, doesnt anticipate them EDITING the scripts though, but it at least should prevent deletion.
If an exploiter deletes a localscript from their client, it wont replicate to the server anyways so the server cannot detect deletion of localscripts outside of localscripts, which exploiters can just delete anyways.
you need to have it check when walkspeed changes
use PropertyChangedSignal and have it on the WalkSpeed property of the humanoid
As the users below said above me, this type of script would not detect exploiters. There are many other ways exploiters exploit and there are several ways they can bypass anti exploit. This does not mean to give up, there are several anti-cheats around devforum that can assist you with your problem. Good luck with your anti-exploit!
If you were to do that then just make it fire an event and as soon as it misses an interval kick the player but it may cause some lag or memory usage all depends. But then again just overall better to use only Server Script Anti-Cheat
Their walkspeed does not replicate, however their position does.
What you should do instead is check their magnitude (last pos to new pos), every X seconds (on the server-side).
If you want to detect if their walkspeed value is changed instead, this has to be done in a localscript, however they can easily bypass that as the client has access to everything on their machine.