CameraBobble Doesn't work when i add an if statement

So i’m checking if attribute value is false then it should do the camerabobble but camerabobbing doesn’t work anymore.

CrouchScript
local UserInputService = game:GetService("UserInputService")

local Players = game.Players

local LocalPlayer = Players.LocalPlayer

local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()

local Animation = script:WaitForChild("CrouchIdle")

local Humanoid = Character:WaitForChild("Humanoid")

LocalPlayer:SetAttribute("isCrouching", false)

local Animator = Humanoid:WaitForChild("Animator")

local Track = Animator:LoadAnimation(Animation)

local TweenService = game:GetService("TweenService")

local isCrouching = LocalPlayer:GetAttribute("isCrouching")

local CrouchCamera = TweenService:Create(Humanoid, TweenInfo.new(0.15, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {CameraOffset = Vector3.new(0,-1.5, 0)})

local NormalCamera = TweenService:Create(Humanoid, TweenInfo.new(0.15, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {CameraOffset = Vector3.new(0, 0, 0)})

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Remotes = ReplicatedStorage:WaitForChild("Remotes")

local function crouchPerson()

Remotes.setAttribute:FireServer("isCrouching", true)

CrouchCamera:Play()

Track:Play()

warn("Crouching")

Humanoid.WalkSpeed = 8

end

local function uncrouchPerson()

Remotes.setAttribute:FireServer("isCrouching", false)

NormalCamera:Play()

Track:Stop()

warn("Not Crouching")

Humanoid.WalkSpeed = 16

end

UserInputService.InputBegan:Connect(function(input, gpe)

if gpe then

return

end

if input.KeyCode == Enum.KeyCode.LeftControl then

crouchPerson()

end

end)

UserInputService.InputEnded:Connect(function(input, gpe)

if gpe then

return

end

if input.KeyCode == Enum.KeyCode.LeftControl then

uncrouchPerson()

end

end)
CameraBobbleScript
--Camera bobbing
-- Shakes the camera when the player is walking

local runService = game:GetService("RunService")
local character = script.Parent
local player = game.Players.LocalPlayer
local attribute = player:GetAttribute("isCrouching")
local humanoid = character:WaitForChild("Humanoid")

function updateBobbleEffect()

	local currentTime = tick()
	if attribute == false then
	if humanoid.MoveDirection.Magnitude > 0.7 then
		local bobbleX = math.cos(currentTime * 7) * .30
		local bobbleY = math.abs(math.sin(currentTime * 7)) * .30      

		local bobble = Vector3.new(bobbleX, bobbleY, 0)

		humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .25)
	else 
		humanoid.CameraOffset = humanoid.CameraOffset * .75
		end
	end
end


runService.RenderStepped:Connect(updateBobbleEffect)
```

Script Location:
image