Can't jump when holding other keys

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’m making a hold shift to run script and I want it to jump.
  2. What is the issue? Include screenshots / videos if possible!
    I cant jump if I hold leftshift and W.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I found out that I can jump if I hold leftshift and D, S, or A.

Here is the code.

local PL = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")

local player = PL.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local camera = workspace.CurrentCamera

local cameraTweenInfo = TweenInfo.new(
	0.75,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local cameraOut = {
	FieldOfView = 100
}

local cameraIn = {
	FieldOfView = 70
}

local tweenCameraOut = TS:Create(camera, cameraTweenInfo, cameraOut)
local tweenCameraIn = TS:Create(camera, cameraTweenInfo, cameraIn)

UIS.InputBegan:Connect(function(input)
	print("Input Began:", input.KeyCode)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		humanoid.WalkSpeed += 8
		tweenCameraIn:Pause()
		tweenCameraOut:Play()
	end
end)

UIS.InputEnded:Connect(function(input, gameProcessedEvent)
	print("Input Ended:", input.KeyCode)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		humanoid.WalkSpeed = 18
		tweenCameraOut:Pause()
		tweenCameraIn:Play()
	end
end)

I think your keyboard is broken

6 Likes

it was just my keyboard the whole time😭 thanks!

1 Like

also in roblox studio if you hold shift and try running you will notice it wont work. THAT situation is not your keyboard.

1 Like

But I tested it with my friend and it worked for his and mine didnt.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.