local UncrouchedSpeed = game.ReplicatedStorage.Player.UncrouchedSpeed.Value
RunService.Heartbeat:Connect(function() -- PAUSE CROUCH ANIMATION IF NOT MOVING
if Humanoid.MoveDirection.Magnitude > 0 then
CAnim:AdjustSpeed(1)
else
CAnim:AdjustSpeed(0)
end
UncrouchedSpeed = game.ReplicatedStorage.Player.UncrouchedSpeed.Value
end)
UIS.InputBegan:Connect(function(key, gameProcessed) -- CROUCHING
if gameProcessed then return end
if key.KeyCode == Enum.KeyCode.LeftControl then
TweenService:Create(Humanoid, CameraTween, {CameraOffset = CameraDown}):Play()
CAnim:Play()
Humanoid.WalkSpeed = 10
end
end)
UIS.InputEnded:Connect(function(key, gameProcessed) -- NOT CROUCHING
if gameProcessed then return end
if key.KeyCode == Enum.KeyCode.LeftControl then
TweenService:Create(Humanoid, CameraTween, {CameraOffset = CameraUp}):Play()
CAnim:Stop()
Humanoid.WalkSpeed = UncrouchedSpeed
end
end)
I want it so if the player crouches while they jump they wouldn’t get slowed down
The first video is how I want it to be, the second video is how it is now