Adding onto @polill00’s response, it seems like what you’re looking for is a type check. You can achieve this with an if statement that uses the IsA method.

Here’s a solution showing what that code would look like:

local Camera = workspace.CurrentCamera
local part = workspace.Model
local function update()
if part:IsA("BasePart") then
part.CFrame = Camera.CFrame*CFrame.new(4,-1,-5)*CFrame.Angles(math.pi/7,math.pi/9,math.pi/2)
elseif part:IsA("Model") then
part:SetPrimaryPartCFrame(Camera.CFrame*CFrame.new(4,-1,-5)*CFrame.Angles(math.pi/7,math.pi/9,math.pi/2))
end
end
Camera:GetPropertyChangedSignal("CFrame"):Connect(update)
update()

You can change your definition of “part” on line 2 to whatever you wish, or re-factor the code in any way to compensate your needs.