Camera Not returning back to player

Ok so I have a script that changes the camera to scriptable

tweenService:Create(camera, TweenInfo.new(.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {CFrame = workspace.Eggs.Basic.cameraPart.CFrame}):Play()
wait(5)
camera.CameraType = Enum.CameraType.Follow

Then it waits 5 seconds to return to player but It does not

Try this.

tweenService:Create(camera, TweenInfo.new(.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {CFrame = workspace.Eggs.Basic.cameraPart.CFrame}):Play()
wait(5)
repeat task.wait()
    camera.CameraType = Enum.CameraType.Follow
until camera.CameraType == Enum.CameraType.Follow

This script still does not work

use Enum.CameraType.Custom and set the camera subject to the Humanoid of the player