Help with Plr:GetMouse().KeyDown:Connect(function(K)

Hello, im trying to make it where if Someone Presses Left Shift something happens, i know i should be using InputBegan but it doesnt work with another thing i need, so when i do “If K == LeftShift then” but nothing happens, how do i call Left Shift for this?

btw its aa custom keybind script, i do this

			if K == game.Players.LocalPlayer.PlayerScripts.KeyBinds.Sprint.SprintKeyBind.Value then

but when the String Value is “LeftShift” it doesnt work, when the string value is a letter it then works.

oh Nevermind, just found out i would have to Use Numbers, 0 is Shift.

Why use plr:GetMouse().Keydown? while you have UserInputService?

local uis = game:GetService("UserInputService")

uis.InputBegan:Connect(function(key, gameProcessed)
    if gameProcessed then return end
    if key.KeyCode == Enum.KeyCode.LeftShift then
       print("Left shift is pressed!")
    end
end)

https://developer.roblox.com/en-us/api-reference/event/UserInputService
https://developer.roblox.com/en-us/api-reference/event/UserInputService/InputBegan

its because when i try to do this it doesnt work at all.

	UserInputService.InputBegan:Connect(function(input)
		if SprintInput == "Hold" then
			if input.KeyCode == game.Players.LocalPlayer.PlayerScripts.KeyBinds.Sprint.SprintKeyBind.Value then
				isSprinting = true
			end
		end
	end)

when I try to make it where if someone presses a button that’s the Value(Value is Q, its a string Value) then something happens, but it doesn’t work so i use the other way and it worked

The other way made it where someone press the Button that is the Value then something happens, do u know how to make work?