I have a script that sets the player’s camera to a block, how can I set it back to the default camera?
here’s the script:
local camera = workspace.CurrentCamera
while wait() do
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.CarCam.CFrame
end
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Custom
In your case you probably want to end the loop so just add a check so that whenever the CameraType is changed it breaks the loop:
while wait() do
if (workspace.CurrentCamera.CameraType == Enum.CameraType.Custom) then
break
end
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.CarCam.CFrame
end