cam = game.Workspace.Camera -- Get camera from workspace cam.CameraSubject = game.Workspace.a -- Set the camera to a object cam.FieldOfView = 25 -- Set FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 26 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 27 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 28 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 29 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 30 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 31 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 32 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 33 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 34 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 35 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 36 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 37 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 38 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 39 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 40 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 41 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 42 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 43 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 44 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 45 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 46 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 47 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 48 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 49 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 50 -- Changes FOV(FieldOfView)
Why does this only work in studio? please help
cam = game.Workspace.CurrentCamera-- Get camera from workspace cam.CameraSubject = game.Workspace.a -- Set the camera to a object cam.FieldOfView = 25 -- Set FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 26 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 27 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 28 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 29 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 30 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 31 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 32 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 33 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 34 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 35 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 36 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 37 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 38 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 39 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 40 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 41 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 42 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 43 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 44 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 45 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 46 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 47 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 48 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 49 -- Changes FOV(FieldOfView) wait(.1) --wait .1 seconds cam.FieldOfView = 50 -- Changes FOV(FieldOfView)
NOTE: Put this in local script because Current Camera can only be called in local scripts.