Could someone look over this and make it work, it kinda works atm but doesn't aim where I want it to and is very eh. This is like my third day on the editor and I pretty much based this all stuff I learnt from garrys mod.
EDIT: If you change the the raycast position to the position of local player and set the roll to 180 in the Math:dirtoAngles that fixes a couple of problems, one of it being upside down. Now it aims at players aim position at a certain angle, really well. A problem that has a risen is that the particle effect of the shooting is in the middle of the gun, not the end of the barrel.