Problem reversing effects of custom camera

I am trying to make a npc chat(Sort of like the Adopt Me! npc chat), but once you are done the camera glitches out and just goes to 0,0,0.

The camera script

local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer


repeat wait() until Player.Character

Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.CamPart.CFrame

script.Parent.Enabled = true

 local MasterControl = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):WaitForChild("MasterControl"))

 MasterControl:Disable()

script.Parent.Enabled = false
Camera.CameraType = "Custom"

local MasterControl = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):WaitForChild("MasterControl"))

MasterControl:Enable()

The “solution” script

wait(2)

local Chat = script.Parent.Parent.Parent.QuestionGuis.EndStage
local OpenChat = script.Parent

	Chat:TweenPosition(
		UDim2.new(0.124, 0, 1, 0), "In", "Sine", 2, false
)

wait(3)

script.Parent.Visible = false
script.Parent.Parent.Enabled = false
script.Parent.Parent.StageOne.Visible = true
script.Parent.Parent.Parent.BillboardGui.Enabled = true
script.Parent.Position = UDim2.new(0.124, 0, 0.579, 0)
script.Parent.Parent.Parent.ScreenGui.LocalScript.Disabled = true
script.Disabled = true
game.StarterGui.ScreenGui.LocalScript.Disabled = true
game.Workspace.CurrentCamera.CameraType = "Fixed"
game.StarterGui.ScreenGui.Enabled = false

I see an error in the output, but it doesn’t look like it’s coming from the script you provided. I don’t see anything named newCFrame inside your script.

If you want to reset the player’s camera or make them return back to the player’s head then I suggest you take a look at this.

What's the best way to reset a player's camera - #2 by C_Sharper

Thank you so much for the help!

That was from another script sorry