Can't jump when standing still

this script causes it

humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
	local jumping = false

	if jumpmode == false or jumping == true or sitting == false then  end
	if jumpmode == true and sitting == true and jumping == false and c.Humanoid.FloorMaterial ~= Enum.Material.Air then
		jumping = true

		local Bod = Instance.new("BodyPosition", c.HumanoidRootPart)
		Bod.Name = "SuperJump"
		Bod.maxForce = Vector3.new(100000, 100000, 100000)
		Bod.Position = c.HumanoidRootPart.CFrame * CFrame.new(0, 50, 0).Position
		game.Debris:AddItem(Bod, .1)

		
		
		SuperJump:AdjustWeight(5, 23)

		SuperJump:Play()
		smoke()
		smoke2()
		SuperJump:AdjustWeight(5, 23)
		wait(1)
		jumping = false
	end
end)

it accelerates the player when moving, and deaccels when not, it also lowers the slope angle

I cant jump because the slope angle is 0 when standing still
Any solutions?

Can you provide the full script?

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)