I have a part in Workspace, it is called CameraPart. I want the camera to look through CameraPart. I do not know if I should use a server script or a local script. I have made a script, but it does not work. It is a server script, here it is:
game.Workspace.CameraPart = game.Workspace.Camera
The problem is that when you're handling something that you want to happen for the player only you should be using a local script, not to mention that the code you provided/written was incorrect. You should be manipulating the CFrame/CameraSubject of the CurrentCamera (an object located in the workspace).
wait(.25) local CurrentCamera = workspace.CurrentCamera local Part = workspace.CameraPart CurrentCamera.CameraType = Enum.CameraType.Scriptable CurrentCamera.CFrame = Part.CFrame
In the code above we have two variables declared, one for the CurrentCamera and another for a part. We change two things of the CurrentCamera, one for the CameraType property and another for changing the CFrame of the CurrentCamera. We change the CurrentCamera to scriptable and then afterwards we change the CurrentCamera's CFrame to the Part's CFrame. That's about it.
If you want it so the Camera to be reverted back to normal, change the CameraType to
CurrentCamera.CameraType = Enum.CameraType.Custom
since custom is the CameraType by default.
It needs to be a localscript.
game.Players.LocalPlayer.CurrentCamera.CameraSubject = workspace.CameraPart
We get the Local Player's "Current Camera( which can only be called from a LocalScript.)", then makes the cameras subject the Camera Part.