This is a simple serverside anti speed script which scales with walkspeed.
I recommend using CloneTrooper1019’s FastWait module for better accuracy.
> --//Functions
> local function CharacterThread(Chr)
> --//Main
> coroutine.resume(coroutine.create(function()
> --//Vars
> local Hum = Chr:WaitForChild("Humanoid")
> local Root = Chr:WaitForChild("HumanoidRootPart")
> --
> if not Hum or not Root then return end
>
> --//Logic Vars
> local lastSpeedChange = 0
> local LastCFrame = Root.CFrame
>
> --//Hooks
> Hum:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
> lastSpeedChange = tick()
> end)
>
> --//Function
> local function Check()
> local ThisPosition = Vector3.new(Root.Position.X,0,Root.Position.Z)
> local LastPosition = Vector3.new(LastCFrame.Position.X,0,LastCFrame.Position.Z)
> local Distance = (ThisPosition - LastPosition).Magnitude
> local WalkSpeed = Hum.WalkSpeed
> --
> if Distance > (WalkSpeed + 3) then
> Root.CFrame = LastCFrame
> end
> end
>
> --//Loop
> while true do
> LastCFrame = Root.CFrame
> wait(1)
> if tick() - lastSpeedChange >= 1 then
> Check()
> end
> end
>
> end))
>
> end
>
> --//Hooks
> game.Players.PlayerAdded:Connect(function(Plr)
> Plr.CharacterAdded:Connect(function(Chr)
> CharacterThread(Chr)
> end)
> end)