user_input_service.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftControl or Enum.KeyCode.RightControl then
load_animation_1:Play()
end
end)
user_input_service.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftControl or Enum.KeyCode.RightControl then
load_animation_1:Stop()
end
end)
When i click, i crouch. I remember see this bug in other script by me, but it was a else problem. Here is not a else problem, so… I dont know what happened here.
Edit: when you use “or Enum.KeyCode.RightControl”, it will check if RightControl exists in the KeyCode Enum and it always does. If you use “or input.KeyCode == Enum.KeyCode.RightControl” it will check if the ended input is the RightControl.