My apologies, for some reason i provided the wrong script in general.
heres the full script for acceleration
local accelerateRate = 35
local decelerateRate = 100
local max = 26
local min = 5
local plr = game.Players.LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local rootpart = chr:WaitForChild("HumanoidRootPart")
local humanoid = chr:WaitForChild("Humanoid")
humanoid.MaxSlopeAngle = min
humanoid.WalkSpeed = min
local lastPosition = rootpart.Position
game:GetService("RunService").Heartbeat:Connect(function(dt)
if humanoid.MoveDirection ~= Vector3.new() then
humanoid.WalkSpeed += dt * accelerateRate
humanoid.MaxSlopeAngle += dt * accelerateRate
else
humanoid.WalkSpeed -= dt * decelerateRate
humanoid.MaxSlopeAngle -= dt * decelerateRate
end
lastPosition = rootpart.Position
humanoid.WalkSpeed = math.clamp(humanoid.WalkSpeed, min, max)
end)