even if i change the value of walkspeed on the client it still wont kick me here is some sample code
function AntiExploit:AntiSpeed(player, humanoid)
if humanoid.WalkSpeed > List.WalkSpeed then
if game.Players:FindFirstChild(player.Name) then
player:Kick("Get yeeted")
end
end
end
i am also calling this function from a server script
Are you sending a remote event to the client? Because walkspeed doesn’t replicate to the server only their position does. You need to have a local script in the client side checking if the person changed something
The thing is if you call it in a server script it will do things the server can do and if you call it from the client it can do things only the client can do
The WalkSpeed is not replicated from the client to the server. Will you need to use another method such as a magnitude check between two points and compare the distance to the desired WalkSpeed. The client will be able to set this value to whatever and the server will not receive the changes so by comparing distances, you are not relying on the WalkSpeed value which can be inaccurate on the server. Hope this helps!
ok i tried both calling it on a server script and local script and the server script did not work but the local script did so you need to check on a local script because walkspeed doesn’t replicate to the server and you cannot detect it.
But the main thing is that you are calling the functions from a server script. This means that it is only running server side. A module does not replicate in the way you are thinking. Calling the function on the client will do what you hope it does whereas doing it on the server will not check for changes the client has made.
Yep! This will stop other exploiters that do not have much scripting knowledge but for the other exploiters you may need to do magnitude checks and other exploiting prevention methods
This isn’t the best method as client side anti-exploit can be bypassed although it work better than currently and will catch out basic exploiters. Look to the method I stated before with comparing positions on the server for better results but for a start, client side anti-exploit would do the trick!
that is not how modules work
you’ll need to send the client’s walkspeed to the server via a remote event for it to actually recognize it
other than that, having it in a seperate script is pretty much useless, i suggest nesting it in game-requiring scripts
Just run magnitude checks on a server script to compare the distances that the character has travelled. Here is a basic example:
local LastData = {}
while wait(1) do
for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
if Player.Character then
if Player.Character:FindFirstChildOfClass("Humanoid") and Player.Character:FindFirstChild("HumanoidRootPart") then
if Player.Character:FindFirstChildOfClass("Humanoid").FloorMaterial then
if not LastData[Player.UserId] then
LastData[Player.UserId] = {
Position = Player.Character.HumanoidRootPart.Position,
Tick = tick(),
}
end
if (LastData[Player.UserId].Position - Player.Character.HumanoidRootPart.Position).Magnitude > Player.Character:FindFirstChildOfClass("Humanoid").WalkSpeed + 1 * (tick() - LastData[Player.UserId].Tick) then
Player:Kick("Moving too fast!")
else
LastData[Player.UserId] = {
Position = Player.Character.HumanoidRootPart.Position,
Tick = tick(),
}
end
end
end
end
end
end
Note that changes may need to be made to that code to account for players moving faster than the walkspeed for gameplay reasons or whatever.