How do I get the camera back to its original position?

local uis = game:GetService("UserInputService")

local zoom = 100
local fieldOfView = 9

local player = game:GetService("Players").LocalPlayer

local character = player.Character or player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera

local function isometricCamera()
	game:GetService("RunService").RenderStepped:Connect(function()
		camera.FieldOfView = fieldOfView
		camera.CameraType = Enum.CameraType.Custom

		if character then
			if character:FindFirstChild("Head") then
				game:GetService("SoundService"):SetListener(Enum.ListenerType.ObjectCFrame, character.Head)
				camera.CFrame = CFrame.new(Vector3.new(character.Head.Position.X + zoom, character.Head.Position.Y + zoom, character.Head.Position.Z + zoom), character.Head.Position)
			end
		end
	end)

end

local function basicCamera()
	camera.CameraType = Enum.CameraType.Custom
end

uis.InputBegan:Connect(function(input, chatting) 
	if chatting then return end -- if player is typing in chat this function will not run
	
	if input.KeyCode == Enum.KeyCode.F then
		isometricCamera()
	elseif input.KeyCode == Enum.KeyCode.R then
		basicCamera()
	end
end)

I want to press the R button, the camera becomes instead of isometric normal, and vice versa how to do it?

you have to store the cameras original cframe in a variable

can u explain how can I do it?

you just have a variable before the heartbeat connection and set it to the cameras cframe and then in basic camera you just set the camera cframe to the original camera frame variable you just set

local uis = game:GetService("UserInputService")

local zoom = 100
local fieldOfView = 9

local player = game:GetService("Players").LocalPlayer

local character = player.Character or player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera

local originalCameraCFrame = nil -- initialize it as nil

local function isometricCamera()
   originalCameraCFrame = camera.CFrame -- set the variable to currennt camera's cframe
	game:GetService("RunService").RenderStepped:Connect(function()
		camera.FieldOfView = fieldOfView
		camera.CameraType = Enum.CameraType.Custom

		if character then
			if character:FindFirstChild("Head") then
				game:GetService("SoundService"):SetListener(Enum.ListenerType.ObjectCFrame, character.Head)
				camera.CFrame = CFrame.new(Vector3.new(character.Head.Position.X + zoom, character.Head.Position.Y + zoom, character.Head.Position.Z + zoom), character.Head.Position)
			end
		end
	end)

end

local function basicCamera()
   camera.CFrame = originalCameraCFrame -- set the camera cframe
	camera.CameraType = Enum.CameraType.Custom
end

uis.InputBegan:Connect(function(input, chatting) 
	if chatting then return end -- if player is typing in chat this function will not run
	
	if input.KeyCode == Enum.KeyCode.F then
		isometricCamera()
	elseif input.KeyCode == Enum.KeyCode.R then
		basicCamera()
	end
end)