Tweening to player not working

I tried changing your original script, I haven’t tested it so I don’t know if it works

local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local button = script.Parent.Button
local looking = false
local camCFrame = nil
local camDistance = nil 
local newPos = nil
local cameraCFrame = nil
local endCFrame = game.Workspace.EventCamera.CFrame
local tweentime = 3
local debouncetime = 0.5
local active = false
button.MouseButton1Click:Connect(function()
	if active then return end active = true
	if looking == false then
camCFrame = camera.CFrame
camDistance = camCFrame.Position - player.Character.Head.Position
		player.Character.Humanoid.WalkSpeed = 0
		player.Character.Humanoid.JumpHeight = 0
		camera.CameraType = Enum.CameraType.Scriptable
		game.TweenService:Create(camera, TweenInfo.new(tweentime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out,0,false,0), {CFrame = endCFrame}):Play()
		wait(tweentime+debouncetime)
                looking = true
	else
               newPos = player.Character.Head.Position + camDistance
               cameraCFrame = CFrame.new(newPos)
		player.Character.Humanoid.WalkSpeed = 16
		player.Character.Humanoid.JumpHeight = 7.2
		game.TweenService:Create(camera, TweenInfo.new(tweentime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out,0,false,0), cameraCFrame):Play() --The problem
		camera.CameraType = Enum.CameraType.Custom
		wait(debouncetime)
               looking = false
	end
	active = false
end)