Bullets comes out by the sky, not the gun

Shit english at the title, hopefully the video will explain the problem:

And here is the weapon code:



if SERVER then
	AddCSLuaFile("shared.lua")
	SWEP.ExtraMags = 4
end

if CLIENT then
    SWEP.PrintName = "IMI Galil"
    SWEP.Slot = 3
    SWEP.SlotPos = 0
	SWEP.DrawAmmo = false
	
	SWEP.AimPos = Vector(-7.12, -5.841, 0.959)
	SWEP.AimAng = Vector(0, 0, 0)
	
	SWEP.SprintPos = Vector(-2.161, 0.119, 3.4)
	SWEP.SprintAng = Vector(-23.601, 25.299, -7.801)
	
	SWEP.Shell = "5.45x39"
	SWEP.AttachmentBGs = {}
		
	SWEP.WMAng = Vector(-5, 0, 180)
	SWEP.WMPos = Vector(0, 15, -4)
	SWEP.SwayInterpolation = "dynamic"
end

SWEP.Attachments = {}

SWEP.BulletLength = 5.45
SWEP.CaseLength = 39

SWEP.Anims = {}
SWEP.Anims.Draw_First = "draw"
SWEP.Anims.Draw = "draw"
SWEP.Anims.Holster = "holster"
SWEP.Anims.Fire = "shoot"
SWEP.Anims.Fire_Aiming = "shoot1"
SWEP.Anims.Idle = "idle"
SWEP.Anims.Idle_Aim = "idle"
SWEP.Anims.Reload = "reload"
SWEP.Anims.Reload_Nomen = "reload"
SWEP.Anims.Reload_Empty = "reload_empty"
SWEP.Anims.Reload_Empty_Nomen = "reload_empty"

SWEP.Sounds = {}
SWEP.Sounds["reload"] = {[1] = {time = 0.2, sound = "weapons/kf_AK47/AK47_Reload_000.wav"},
	[2] = {time = 0.45, sound = "weapons/galil/galil_mag_out.wav"},
	[3] = {time = 2.4, sound = "weapons/galil/galil_mag_in.wav"}}
SWEP.Sounds["reload_empty"] = {[1] = {time = 0.2, sound = "weapons/kf_AK47/AK47_Reload_000.wav"},
	[2] = {time = 0.45, sound = "weapons/galil/galil_mag_out.wav"},
	[3] = {time = 2.4, sound = "weapons/galil/galil_mag_in.wav"},
	[4] = {time = 3.6, sound = "weapons/galil/galil_bolt.wav"}}	
	
SWEP.FireModes = {"auto", "semi"}

SWEP.Category = "FA:S 2"
SWEP.Base = "fas2_base"
SWEP.Author            = ""
SWEP.Contact        = ""
SWEP.Purpose        = ""

SWEP.ViewModelFOV    = 72
SWEP.ViewModelFlip    = false

SWEP.Spawnable            = true
SWEP.MuzzleAttachment			= "1"
SWEP.AdminSpawnable        = true

SWEP.VM = "models/weapons/v_models/v_blackops_galil.mdl"
SWEP.WM = "models/weapons/w_rif_galil.mdl"
SWEP.WorldModel   = "models/weapons/w_rif_galil.mdl"

-- Primary Fire Attributes --
SWEP.Primary.ClipSize        = 32
SWEP.Primary.DefaultClip    = 64
SWEP.Primary.Automatic       = true    
SWEP.Primary.Ammo             = "7.62x39MM"
 
-- Secondary Fire Attributes --
SWEP.Secondary.ClipSize        = -1
SWEP.Secondary.DefaultClip    = -1
SWEP.Secondary.Automatic       = false
SWEP.Secondary.Ammo         = "none"

-- Deploy related
SWEP.FirstDeployTime = 0.70
SWEP.DeployTime = 0.8
SWEP.DeployAnimSpeed = 0.8

-- Firing related
SWEP.Shots = 1
SWEP.FireDelay = 0.080
SWEP.Damage = 37
SWEP.FireSound = "weapons/galil/galil_fire.wav"
SWEP.EmptySound = "weapons/empty_assaultrifles.wav"

-- Accuracy related
SWEP.HipCone = 0.05
SWEP.AimCone = 0.005
SWEP.SpreadPerShot = 0.007
SWEP.MaxSpreadInc = 0.03
SWEP.SpreadCooldown = 0.18
SWEP.VelocitySensitivity = 1.8
SWEP.AimFOV = 10

-- Recoil related
SWEP.ViewKick = 1.2
SWEP.Recoil = 0.12

-- Reload related
SWEP.ReloadTime = 3.1
SWEP.ReloadTime_Nomen = 3.1
SWEP.ReloadTime_Empty = 4.3
SWEP.ReloadTime_Empty_Nomen = 4.3


Your view model is missing muzzle attachment. It should be the very first attachment on your gun.

And how would i do that?

Do what? Add an attachment? By recompiling the model.

OR you can try using this hook:

Also, a useful too: http://steamcommunity.com/sharedfiles/filedetails/?id=195065185