It printed Q in the output, but it didn't print "Combo"
elseif input.KeyCode == Enum.KeyCode.Q then print("Q") module.Punch(player) if input.UserInputType == Enum.UserInputType.MouseButton1 then print("Couter") module.Combo(player) end
This may be not the exact solution, but you can try UIS:IsKeyDown()
. It will check if Q is being held down, and it will return either true or false. There is also a UserInputType alternative, however, it's not related to your answer.
UIS.InputBegan:Connect(function(input, GPE) if GPE then return end if UIS:IsKeyDown(Enum.KeyCode.Q) then if input.UserInputType == Enum.UserInputType.MouseButton1 then module.Combo(player) end end end)
local currTimeE1 = 0 local prevTimeE1 = 0 UIS.InputBegan:Connect(function(input, IsTyping) if IsTyping then return elseif input.KeyCode == Enum.KeyCode.Q then module.Punch(player) prevTimeE1 = 0 end end) UIS.InputBegan:Connect(function(input, IsTyping) if IsTyping then return elseif input.UserInputType == Enum.UserInputType.MouseButton1 then currTimeE1 = tick() local passedtimeE1 = currTimeE1 - prevTimeE1 if passedtimeE1 < 1 then module.Combo(player) else return end end end)
I updated this one, but it still doesnt work