local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = script.Parent.Humanoid
UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function()
if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift)then
humanoid.WalkSpeed = 32
game.Workspace.CurrentCamera.FieldOfView = 80
end
end)
UserInputService.InputEnded:Connect(function()
game.Workspace.CurrentCamera.FieldOfView = 70
humanoid.WalkSpeed = 16
end)
This script make player move faster if shift key is pressed. The problem is whenever I press another key while holding shift, the script ends. How do I only make the script end when I am not holding shift anymore?

1 comment
InputEnded(Key, GameProcessed) works.