IsValid Particle?

Is there a way to check if a particle IsValid? I saw there was CNewParticleEffect:IsValid() but I am pretty sure I was using it incorreclty.


game.AddParticles("particles/item_fx.pcf")
ITEM.Name = "Vivid Plasma"
ITEM.Price = 90000
ITEM.Attachment = 'eyes'
ITEM.Material = "vgui/particlepics/Vivid_Plasma.png"
ITEM.Particle = "superrare_plasma2"

PrecacheParticleSystem(ITEM.Particle)

function ITEM:OnEquip(ply, modifications)
	ParticleEffectAttach(self.Particle, 4, ply, ply:LookupAttachment("eyes"))
	ply:SendLua("timer.Simple(1, function() LocalPlayer():StopParticles() end)")
end

function ITEM:OnHolster(ply)
	if self.Particle:IsValid() then
		ply:StopParticles()
	end
end

As you can see, I’ve attempted validation myself without success. Thanks for any help in advance!


IsValid(self.Particle)

You realize that self.Particle is actually a string right?



ITEM.Particle = "superrare_plasma2"


As far as i can see this would be better:



function ITEM:OnHolster(ply)
    ply:StopParticlesNamed(self.Particle)
end


References:

Cheers man, I’ll give that a runthrough