The problem is that i made a script that if you die then it makes you to the main menu (It changes the cframe of camera) but when after one death player click the play button once more The camera is set to camera type custom but it does not follow the player when i made a script making the camera subject (local script) to player humanoid it does not follow it i made a wait 1 second i made a change camera cframe to humanoid cframe but nothing works :(

Heres the script that changes camera to follow the player:

repeat wait()
	Camera.CameraType = Enum.CameraType.Custom
	until Camera.CameraType == Enum.CameraType.Custom
	Camera.CameraSubject = hum.Humanoid
	Camera.CFrame = hum.Humanoid.CFrame

Send help please!