So Im trying to make a anti exploit and if their walkspeed is just above 16 I will teleport them back to the position but I dnt know the math for 16 walkspeed I heard its studs per second
so for example since u cant see walkspeed on the server
Player walks 20 studs per second then I teleport them back
Here is a script that will print warnings when players travel faster than their WalkSpeed.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) -- wait for character to be inserted into Workspace character.AncestryChanged:wait() local lastPosition = character.HumanoidRootPart.Position while character.HumanoidRootPart:IsDescendantOf(game) do local actualTime = wait(1) local expectedMaxDistance = character.Humanoid.WalkSpeed * actualTime local actualDistance = (character.HumanoidRootPart.Position - lastPosition) .magnitude local actualSpeed = actualDistance / actualTime lastPosition = character.HumanoidRootPart.Position if actualSpeed > character.Humanoid.WalkSpeed then print(player.Name.." might be using hax! They traveled at " ..actualSpeed.." studs/second, but their WalkSpeed is " ..character.Humanoid.WalkSpeed..".") end end end) end)
Note that this doesn't account for falling, network rubberbanding, inaccuracies in the Roblox engine regarding character speed, changes in position due to spawning, etc. Tracking a player's speed should only be one small heuristic used alongside other methods to determine if hacks are being used!