For ContextActionService it seems like whenever you press the key, the inputstate is Enum.UserInputState.Begin, and when you release the key, it is Enum.UserInputState.End. I want to ignore all states except Begin.
local CAS = game:GetService("ContextActionService")
local function bindAction(actionName, userInputState, inputObject)
if not userInputState == Enum.UserInputState.Begin then return end
print("What?") --This is triggering even though the input state is at end.
end
local keyCodes = {Enum.KeyCode.Q, Enum.KeyCode.W, Enum.KeyCode.E}
CAS:BindAction("Test", bindAction, false, unpack(keyCodes))
However, in the following line:
if not userInputState == Enum.UserInputState.Begin then return end
It seems to ignore it completely, even when the input state is end. So when the input state is User.InputState.End, isn’t the statement suppose to be
if not false then return end
--Which equals this, but when its true it isn't returning end?
if true then return end
I am not entirely sure what I’m going wrong, can somebody explain why?