addItem(%client.player.tool[0],%file.readLine());
Should be
%player.addItem(%file.readLine(), %client);
Also, there are a lot of unnecessary lines of code in your functions. It seems to me like you don't understand how the code works, and are just copy pasting other peoples work together. I recommend you read through a lot of other add-ons before you try to make your own, to try and get an understanding of how torque works.