Alright, so what I'm trying to do is lock camera and move it only when server fires you with CFrame. Script is obviously client-sided.
My code so far:
local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable -- does not lock the camera workspace.MoveCamera.OnClientEvent:Connect(function(cframe) camera.CFrame = cframe -- that moves the camera, but doesn't change zoom and player still can move camera afterwards )
Problems are written in comments, but I'll repeat
You need to set the CameraType property to "Scriptable", and then immediately set its CFrame.
Example:
camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = CFrame.new(0,0,0)
You can unlock it by setting its CameraType to "Custom".
camera.CameraType = Enum.CameraType.Custom
If you want to fire the client, you can use this solution:
RemoteEvent.OnClientEvent:Connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = CFrame.new(0, 0, 0) end)