Detecting if control is pressed server-side

Hello all, I have a script which loops an action after pressing a key. (see my previous thread about this)

Since the loop is in server/main.lua, how do I make it detect if the client has pressed a key?

Press E to do something
--doing something
If <key> is pressed, break loop

From what I know (I could be wrong), the server can’t detect whether a key is pressed, so how could I do this?
IsControlJustReleased isn’t a server side thing, right?

Detect the key pressing client side and then trigger a server side event

Edit: I also recommend watching all Jeva’s tutorials