How to make it when a player presses a key it does somthing

how to make it when a player presses a key it does somthing

go to the unit u want to press something,go in controls of the unit and set keybinds for keydown only (run a script for keydown