Sorry guys, im still very new to scripting and I appreciate the help you have give me but I can't think of a way to fix this.
This, im guessing, is the main problem: WeaponEnt[0] = "f"
Another problem is the data im reading from the file: needs trim() for /n/r
Another problem I have just seen is that im using a static size for the weapon model name, variable weapon, which should be dynamic because not all the names are 18 chars.