I was working on an fps system when I noticed that pressing 2 or 4 stopped all movement when running
local userInput = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer
local sprintSpeed = 30
local walkSpeed = 16
userInput.InputBegan:Connect(function(IO, GPE)
if not GPE then
local keycode = IO.KeyCode
print(keycode)
if keycode == Enum.KeyCode.LeftShift then
player.Character.Humanoid.WalkSpeed = sprintSpeed
end
end
end)
userInput.InputEnded:Connect(function(IO, GPE)
if not GPE then
local keycode = IO.KeyCode
print(keycode)
if keycode == Enum.KeyCode.LeftShift then
player.Character.Humanoid.WalkSpeed = walkSpeed
end
end
end)
Using :IsKeyDown didn’t work either
My apologies if this is in the wrong category, I was not sure if it was an engine bug or an issue with my script