InputBegan not Working

Trying to make it so when someone presses the Left Shift key, a remote event is fired so the person can sprint but it is not working at all. I’ve added print statements to both InputBegan and InputEnded and it prints ‘stop’ but not ‘run’. I’m sure the code itself is fine so it might be other lines within the local script that is preventing it from working accordingly so I’ll add the pastebin link as well.

UIS.InputBegan:Connect(function(input,isTyping)
	if isTyping then return end 
	if input.KeyCode == Enum.KeyCode.LeftShift then 
		wait()
		sprinting = true
		Events.Run:FireServer(23)
		print('run')
	end
	
	
end)

UIS.InputEnded:Connect(function(input,isTyping)
	if isTyping then return end 
	if input.KeyCode == Enum.KeyCode.LeftShift then 
		wait()
		sprinting = false
		Events.Run:FireServer(16)
		print('stop')
	end
	
	
end)

Do you have shiftlock on? LeftShift with InputBegan doesn’t fire when it’s enabled, but InputEnded does.

Omg yes you are right! Thank you so much my heads been banging on this problem for hours.

1 Like