Camera Change not working

Hi, so I want the camera locked in first person, but when the player presses “C” it unlocks the camera and are forced out of first person and can move the mouse freely. It’s not working. The script gives no errors and goes through the entire code but it doesn’t even do anything. Here is my current code:

local plr = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local count = 0

print("set variables")

UIS.InputBegan:Connect(function(input)
	print("made func")
	if input.KeyCode == Enum.KeyCode.C and count == 0 then
		plr.CameraMinZoomDistance = 3
		count = 1
	elseif count == 1 and input.KeyCode == Enum.KeyCode.C then
		plr.CameraMinZoomDistance = 0.5
		count = 0
	end
	print("did everything")
end)

Can anyone help?