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