Animation that goes faster the higher the walkspeed is

  1. What do you want to achieve?

I want it so the faster the player is running, the faster the animation goes

  1. What is the issue?

I dont really know how to do that, and I cant find good ressources

  1. What solutions have you tried so far?

I have tried to play around with :AdjustSpeed and stuff like that, but had no luck

local player = game.Players.LocalPlayer
local character = script.Parent
local humanoid = character.Humanoid

local PlrStats = player:WaitForChild("PlrStats")


local WALKSPEED = 11
local RUNSPEED = (18 + (PlrStats.Speed.Value / 100 * 10)) -- 18 is default sprinting speed

local animation = script:WaitForChild("RunAnim")
local animTrack = humanoid:LoadAnimation(animation)


local Acceleration = (PlrStats.Acceleration.Value / 50) -- so 10 points in acceleration means the acceleration adding is 1 + 0.2 = 1.2

local DelayTime = (PlrStats.Acceleration.Value / (200 * -1)) -- so 10 points in acceleration means the DelayTime is 0.33 - 0.03 = 0.30

local uis = game:GetService("UserInputService")

local run = uis.InputBegan:Connect(function(input, gpe)
	if gpe then return end
	if input.KeyCode == Enum.KeyCode.LeftShift and humanoid.MoveDirection.Magnitude > 0 then

		animTrack:Play()
	
		humanoid.WalkSpeed += (RUNSPEED / 18)
		repeat

			humanoid.WalkSpeed += (0.7 + Acceleration)
			wait(0.33 + DelayTime)
		until
		humanoid.WalkSpeed >= RUNSPEED or humanoid.MoveDirection.Magnitude <= 0 or humanoid.WalkSpeed <= 11
		if humanoid.WalkSpeed > RUNSPEED then
			humanoid.WalkSpeed = RUNSPEED
		end
	end 
end)

uis.InputEnded:Connect(function(input, gpe)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		animTrack:Stop()
		humanoid.WalkSpeed = 11
	end
end)