Divide what you want to happen into small parts..
first you'd like the player to use the pickaxe..
on key pressed -
--player use pickaxe (these could be a number of actions (set position, rotate, etcetera)
Then you want something to happen when pickaxe hits the wall
Pickaxe on collision with wall -
-- pickaxe stick to wall
-- player start climbing (agian these would be a number of actions)
Compare the player position with the pickaxe to see if the player has to use it again to get higher
if so repeat the pickaxe commands..
etcetera