The camera zooming will only work for first time. Also it will print sprint on clicking shift even if you are not walking.
local player = game.Players.LocalPlayer
local Char = player.Character or player.CharacterAdded:Wait()
local humanoid = script.Parent.Humanoid
local UserInputService = game:GetService("UserInputService")
local Running = false
UserInputService.InputBegan:Connect(function(Input, gameProcessed)
if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift)and not gameProcessed then
print("sprint")
Running = true
humanoid.WalkSpeed = 32
end
end)
UserInputService.InputEnded:Connect(function(Input, gameProcessed)
if Input.KeyCode == Enum.KeyCode.LeftShift and not gameProcessed then
Running = false
humanoid.WalkSpeed = 16
end
end)
repeat wait() until Running == true
print("ZOOM")
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
wait()
end
repeat wait() until Running == false
print("ZOOMBACK")
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
wait()
end

2 comments
What do you mean by "you can use workspace"?
Forgot, One person warned me that using "workspace" is deprecated