local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = script.Parent.Humanoid
UserInputService = game:GetService("UserInputService")
humanoid.Running:Connect(function(speed)
UserInputService.InputBegan:Connect(function()
if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) and speed > 0 then
humanoid.WalkSpeed = 32
for i = 1, 5 do
print(speed)
game.Workspace.CurrentCamera.FieldOfView = (70 + (i * 2))
wait()
end
else end
end)
UserInputService.InputEnded:Connect(function()
humanoid.WalkSpeed = 16
for i = 1, 5 do
game.Workspace.CurrentCamera.FieldOfView = (80 - (i * 2))
wait()
end
end)
end)
I don't want the camera to zoom if you are not walking. That is why I put humanoid.Running:Connect(function(speed) in the script. However, The camera will still zoom even if you are not walking. Please fix this
