Help with Muzzleflashes

So, i’m trying to create a dual weapon base for a gamemode that allows for tracers/muzzleflashes to be repositioned so that it will work with where the “barrel” is, according to the Swep Construction Kit models…
I’ve got the tracers down to a fine point, but i’m having loads of trouble with the MuzzleFlashes. I resorted to copypasting bits from Customizeable Weaponry (With Leet’s permission, of course)
So far i have been completely unsuccessful in making the muzzleflashes even appear.
Could you fine gentleman look over this code and give me some advice?
-The PrimaryFire function
[lua]

function SWEP:PrimaryAttack()
local self = self.Weapon;
local owner = self:GetOwner()

 local clip1 = self:Clip1();
    local clip2 = self:Clip2();
    local gun = 0
    if (clip2 > clip1) then
        gun = 1;
    elseif (clip1 == 0) then
        return;
	else gun = 0
    end
	 if (gun == 0) then //Right
		if self:Clip1() == 0 then
		return false end
        self:SetClip1(clip1 - 1);
    elseif (gun == 1) then    //Left
		if self:Clip2() == 0 then
		return false end
        self:SetClip2(clip2 - 1);
    end
    
    local owner = self.Owner;
	if CLIENT then
	self:MakeMuzzleFlash()
if (gun == 0) then
		local pos, ang = self:GetBonePos(owner:GetViewModel(1), "ValveBiped.muzzle" )
		local VectorToAdd = Vector(0,0,10)
		local flashpos = (pos + ang:Forward() * VectorToAdd.x + ang:Right() * VectorToAdd.y + ang:Up() * VectorToAdd.z)
		ParticleEffect("cstm_child_muzzle_small", flashpos, self.Owner:EyeAngles(), owner:GetViewModel():GetAttachment(1))


    else
		local pos, ang = self:GetBonePos(owner:GetViewModel(0), "ValveBiped.muzzle" )
		local VectorToAdd = Vector(0,0,10)
		local flashpos = (pos + ang:Forward() * VectorToAdd.x + ang:Right() * VectorToAdd.y + ang:Up() * VectorToAdd.z)
		ParticleEffect("cstm_child_muzzle_small", flashpos, self.Owner:EyeAngles(), owner:GetViewModel( 0 ))
end
end

self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self:EmitSound( self.Primary.Sound )

self:ShootBullets( self.Primary.Damage, self.Primary.Bullets, self.Primary.Cone, 0 )
self:AddViewKick()

-- effects

end
[/lua]

MakeMuzzleFlash function (snipped from Customizeable Weaponry. Also using his muzzle effects as a placeholder)

[lua]

if CLIENT then
function SWEP:MakeMuzzleFlash() – lololol
vml = self.Owner:GetViewModel(0)
vmr = self.Owner:GetViewModel(1)
muzl = vm:GetAttachment(“1”)
muzl2 = vm:LookupAttachment(“1”)
local posl, angl = self:GetBonePos(owner:GetViewModel(1), “ValveBiped.muzzle” )
local posr, angr = self:GetBonePos(owner:GetViewModel(0), “ValveBiped.muzzle” )
local VectorToAdd = Vector(0,0,10)
local flashposleft = (posl + angl:Forward() * VectorToAdd.x + angl:Right() * VectorToAdd.y + angl:Up() * VectorToAdd.z)
local flashposright = (posr + angr:Forward() * VectorToAdd.x + angr:Right() * VectorToAdd.y + angr:Up() * VectorToAdd.z)

	muzl = flashposleft
	muzr = flashposright
	if (muzl or muzr) then
		if not self.Em then
			self.Eml = ParticleEmitter(muzl.Pos)
			self.Emr = ParticleEmitter(muzr.Pos)
		end

	end
	
end

end
[/lua]

In his script, he uses an actual effect file for some things. I don’t see why i’d need to copy that part from him, as ParticleEffect should be able to do the job just fine.

What am i missing here?
Thanks in advance!