Basically I’m making momentum running, and I send out my script whilst the while loop is running on the client alongside checking if the character is at their peak speed. The minute they reach their peak speed, I send out the remoteevent to run my anti-cheat
Client Script:
repeat task.wait(.5)
Ran += 1
if Character.Humanoid.WalkSpeed < MAX_SPEED then
Character.Humanoid.WalkSpeed += 1
print(Ran)
if Ran >= 10 then
if AlreadyMax then continue end
AlreadyMax = true
print("you dirty little boy you just keep printing")
ServerE:FireServer(input, ActionClass, Action, Params)
else
AlreadyMax = false
end
end
until IsSprinting == false or Character.Humanoid.MoveDirection.Magnitude == 0
Now, on the server if the fireremote runs a loop for the anti, but the issue comes when I release
On the released (which I did not show because I don’t believe the script is that important, unless said otherwise), I fire a false value to the server which in nature should stop and completely render the while loop inactive, yet it’ll continue to play.
Server:
local Velocity --: Vector3
local HoldingDown = Params.Held
task.spawn(function()
while true do
print(Params.Held)
if Params["Player"] == nil or Params.Held == false then print("lol") break end
DeltaTime = tick() - PreviousTime
PreviousTime = tick()
CurrentPos = Params["Player"].Character.HumanoidRootPart.Position
task.wait(1.5)
OldPos = CurrentPos
CurrentPos = Params["Player"].Character.HumanoidRootPart.Position
print("still running")
Velocity = (CurrentPos - OldPos)/DeltaTime
if Params["Player"] == nil or Params.Held == false then print("lol") break end
end
return
end)