Is it possible to restrict a player's input so that they can only perform certain tasks?

I have a branch right now, however, that seems to be the problem. If “Close1” is activated, this allows the keypress to “kick” the ball. So if player 1 is close, there is nothing stopping player 2 from kicking the ball as well.