LUA Question about CLUParticleEmitters

Im learing LUA and the first little thing im trying to make is on TTT, it triggers a smoke explosion when you left click and hit somebody. It works but the smoke is really weak and looks very transparent. I have used the code from the TTT smoke grenade, can anyone help in making it darker or not see through or somehing ?



if CLIENT then
 print("lol2")
			local ply = LocalPlayer()	
			local vector = ply:GetPos()
			local em = ParticleEmitter(vector)

				for i=1,20 do
					local r = math.random(10,30)
					local prpos = VectorRand() * r
					prpos.z = prpos.z + 32
					local model = Model("particle/particle_noisesphere")
					local p = em:Add(model ,vector)
						if p then	
						local gray = math.random(75, 200)
						p:SetColor(gray, gray, gray)
						p:SetStartAlpha(255)
						p:SetEndAlpha(255)
						p:SetVelocity(VectorRand() * math.Rand(900, 1300))
						p:SetLifeTime(0)
						
						p:SetDieTime(math.Rand(50, 70))

						p:SetStartSize(250)
						p:SetEndSize(math.random(1, 40))
						p:SetRoll(math.random(-180, 180))
						p:SetRollDelta(math.Rand(-0.1, 0.1))
						p:SetAirResistance(600)

						p:SetCollide(true)
						p:SetBounce(0.4)

						p:SetLighting(false)
						end
					em:Finish()
				end
			end



also this error is printed to the console when you try left click

Check if your emitter is valid or not equal to nil

I put this in the code to check if it was nil



if em == nil then print("test") end


It did not return test so it is not nil, I dont know how to check if its valid =/



if IsValid(em) then


Thanks for the code extra



if IsValid(em) then print("IS VALID") end


It did not print IS VALID so its obviously not valid