make actor fire in last direction standing

How do i make an actor fire in the last direction he was standing. like if the last key down what up if you press space he will fire up and not down. please be specific i am still new to the scripting
thanks[/img][/list][/code]
