Here’s my code:
--!nonstrict
local Rep = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local plr = Players.LocalPlayer
local plrgui = plr:WaitForChild("PlayerGui")
local cam = workspace.CurrentCamera
local gui = plrgui:WaitForChild("dialogue")
local ui = gui:WaitForChild("Mainframe")
local text = ui:WaitForChild("TextLabel")
local title = gui:WaitForChild("Title")
local npcTitle = title:WaitForChild("TextLabel")
local TS = game:GetService("TweenService")
local speak = require(Rep:WaitForChild("Speak"))
local remotes = Rep:WaitForChild("NPC")
local interact = remotes:WaitForChild("Interact")
local morrowCamPart = workspace:WaitForChild("MontaguCamPart")
cam.CameraType = Enum.CameraType.Scriptable
interact.OnClientEvent:Connect(function(name, text)
npcTitle.Text = name
cam.CameraType = Enum.CameraType.Scriptable
local tween = TS:Create(cam, TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {CFrame = morrowCamPart.CFrame})
tween:Play()
tween.Completed:Connect(function()
cam.CameraType = Enum.CameraType.Scriptable
end)
local npc = game.Workspace.NPCS[name]
local head = npc.Head
speak:Speak(plr, head, head.Mouth, text)
end)
For some reason, the camera type doesn’t change at all.