Associated lines of code (Does not work)
e1 = Uis.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
if not ProneAnimationTrack.IsPlaying then
ProneAnimationTrack:Play()
if humanoid then
humanoid.WalkSpeed = 5
end
else
ProneAnimationTrack:Stop()
if humanoid then
humanoid.WalkSpeed = 16
end
end
elseif input.KeyCode == Enum.KeyCode.Tab then
InventoryGui.Enabled = not InventoryGui.Enabled
end
end)
However if i remove the last keycode check it suddenly starts working
e1 = Uis.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
if not ProneAnimationTrack.IsPlaying then
ProneAnimationTrack:Play()
if humanoid then
humanoid.WalkSpeed = 5
end
else
ProneAnimationTrack:Stop()
if humanoid then
humanoid.WalkSpeed = 16
end
end
end
end)
I am really confused and i cant understand what can cause this, please help if you can