There's no need to go about making a script. If you know of the "bind" and "kill" commands for the console, just type this into the console:
**bind (desired key here) "kill"**
_Example: bind x "kill"_
Just type that into the console once, and you should be good to go from that point on. You can choose any key that you wish, but please note that you need to know the name of the key you are assigning it to if you are using the keypad (assuming your keyboard has the keypad).