Answered by
5 years ago Edited 5 years ago
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).
2 | local CurrentCamera = workspace.CurrentCamera |
3 | local Part = workspace.CameraPart |
5 | CurrentCamera.CameraType = Enum.CameraType.Scriptable |
6 | 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.