Assigning keys to animations?

im trying to do the same thing but with a weapon but no one has helped =(