Putting TF2 Unusual Partical Effects on Hats. *Help*

I’m currently scripting some tf2 hats onto a darkrp server with PointShop by _Undefined. I have got the hats to go on the persons head but I’m trying to put the unusual particle effects onto the hats. I’m new to lua coding but this is the code I have done so far.



ITEM.Name = 'Bubbling Batter Helmet'
ITEM.Price = 10000
ITEM.Model = 'models/player/items/scout/batter_helmet.mdl'
ITEM.Attachment = 'eyes'

function ITEM:OnEquip(ply, modifications)
	ply:PS_AddClientsideModel(self.ID)
end

function ITEM:OnHolster(ply)
	ply:PS_RemoveClientsideModel(self.ID)
end

function ITEM:ModifyClientsideModel(ply, model, pos, ang)
	PrecacheParticleSystem("unusual_bubbles")
	pos = pos + (ang:Forward() * -7)
	ang:RotateAroundAxis(ang:Right(), 0)
	ParticleEffectAttach("unusual_bubbles",PATTACH_ABSORIGIN_FOLLOW,prop,0)
	
	return model, pos, ang
end


The error I get in console are:
Attemped to precache unknown particle system “unusual_bubbles”!

Any help is appreciated. Thanks.

The error it’s giving you means that the particles you are trying to use are more than likely not defined correctly. Do the path, like materials/particles/particlehere.whateverfilextensionitis. Not sure where they’re located. That might help your issues.

Thank you very much however the particles dont actually have a path. They are all stored in item_fx.pcf which I tried including in the code, but it still failed horribly with the same errors.

I need help with this too…

Load *.pcf files and precache the particle systems on both client and server (can be done in “Initialize”):

[lua]
game.AddParticles(“particles/item_fx.pcf”)
PrecacheParticleSystem(“unusual_bubbles”)
[/lua]

Ok Dude Here Is The Code :confused: I’ve Been Working On, Particle Link --> https://dl.dropboxusercontent.com/u/156065504/particles.rar


game.AddParticles("particles/item_fx.pcf")
ITEM.Name = 'Warpig Bandana - Epic Effect'
ITEM.Price = 4000
ITEM.Model = 'models/player/items/soldier/soldier_warpig_s2.mdl'
ITEM.Attachment = 'eyes'
ITEM.Particle = "unusual_meteor_shower_parent_green"

PrecacheParticleSystem(ITEM.Particle)

function ITEM:OnEquip(ply, modifications)
	ply:PS_AddClientsideModel(self.ID)
	ParticleEffectAttach(self.Particle, PATTACH_POINT_FOLLOW, ply, ply:LookupAttachment("eyes"))
end

function ITEM:OnHolster(ply)
	ply:PS_RemoveClientsideModel(self.ID)
	ply:StopParticles()
end

function ITEM:ModifyClientsideModel(ply, model, pos, ang)
	pos = pos + (ang:Forward() * -3) + (ang:Up() * -3)
	
	return model, pos, ang
end

– Particle ids! https://developer.valvesoftware.com/wiki/List_of_TF2_Particles
All You Need Is The item_fx.pcf

– Thumbs Up/ +Rep If I Helped!!

[lua]
//This will create the particle system at the origin of the hat, i don’t think that would cause problems on hats, but use attachments
ParticleEffectAttach(“unusual_bubbles”,PATTACH_ABSORIGIN_FOLLOW,prop,0)
[/lua]

Guys this thread is a year old

However, i do have a question

I’m also doing these for pointshop, however how do i stop them from drawing in the player’s view?

Sorry for hijacking this thread and thanks in advance.

Ok To Make It From The Players View You Need To Find The Correct Place. For Example,


	ParticleEffectAttach(self.Particle, PATTACH_POINT_FOLLOW, ply, ply:LookupAttachment("eyes"))  // "eyes" Represents a bone on the player, Try This Code :/

if GetConVar("thirdperson_active"):GetBool() then
		ParticleEffectAttach("unusual_storm", PATTACH_POINT_FOLLOW, ply, ply:LookupAttachment("eyes"))	
	else
		ply:PS_Notify("The particle Unusual storm was disabled because you're in first person.")
	end




There are a couple ways. One is to check if the local player’s view entity is the player with the hat.

Could you give an example or explain a bit more detailed? I’m not understanding what you are saying very well.

The basic idea is that at any given time, the player is viewing the world from some entity or the other. This entity is their viewentity. By checking if their view entity is themselves, you can determine whether they are able to view the effect.
Garry’s example CS weapons do this. (I think) I’ll be back with an example code snippet.