-- i didnt write this, its a lot of redundant code but it works so i wont bother changing it

ChangeAmount = 5 
Player = game.Players.LocalPlayer 
Camera = workspace.CurrentCamera 
Mouse = Player:GetMouse() 

local view = false

function FOV(key)
	key = key:lower()
	if key == "[" then
		if view then
			Camera.FieldOfView = Camera.FieldOfView - ChangeAmount
			game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			game.Workspace.CurrentCamera.CameraType = "Custom"
			view = true	
			view = false
			return 
		end
		if not view then
			Camera.FieldOfView = Camera.FieldOfView - ChangeAmount
			game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			game.Workspace.CurrentCamera.CameraType = "Custom"
			view = true	
		end
	end
	
end

Mouse.KeyDown:connect(FOV)

function FOV(key)
	key = key:lower()
	if key == "]" then
		if view then
			Camera.CameraSubject=game.Players.LocalPlayer.Character.Head
			Camera.FieldOfView = Camera.FieldOfView + ChangeAmount
			game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			game.Workspace.CurrentCamera.CameraType = "Custom"
			view = true	
			view = false
			return 
		end
		if not view then
			Camera.CameraSubject=game.Players.LocalPlayer.Character.Head
			Camera.FieldOfView = Camera.FieldOfView + ChangeAmount
			game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			game.Workspace.CurrentCamera.CameraType = "Custom"
			view = true	
		end
	end
end

Mouse.KeyDown:connect(FOV)

function FOV(key)
	key = key:lower()
	if key == "m" then
		if view then
			Camera.CameraSubject=game.Players.LocalPlayer.Character.Head
			Camera.FieldOfView = 70
			game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			game.Workspace.CurrentCamera.CameraType = "Custom"
			view = true	
			view = false
			return 
		end
		if not view then
			Camera.CameraSubject=game.Players.LocalPlayer.Character.Head
			Camera.FieldOfView = 70
			game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			game.Workspace.CurrentCamera.CameraType = "Custom"
			view = true	
		end
	end
end

Mouse.KeyDown:connect(FOV)

