Trying to make particle hat help me

I’m Trying to make particle unusual hat in my server


ITEM.Name = 'Captain Unusual Full Moon'
ITEM.Price = 150000
ITEM.Model = 'models/player/items/soldier/soldier_officer.mdl'
ITEM.Attachment = 'eyes'
ITEM.AllowedUserGroups = { "superadmin" }

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)
	model:SetModelScale(1.1, 0)
	pos = pos + (ang:Forward() * -5)
	
	ParticleEffectAttach("unusual_fullmoon_cloudy",PATTACH_ABSORIGIN_FOLLOW,model,0)
	return model, pos, ang
end


It code spam many particle
Only me can see particle other player can’t see :c

http://img43.imageshack.us/img43/7783/mvm0.jpg

anyone please help me

function ITEM:ModifyClientsideModel(ply, model, pos, ang)< That part, not sure how this works sorry. but i think it has something to do with that.

Edit:this is for the only you can see the particales part.

I don’t know what should I do right now :<

Since i’m not pro at lua, wait till a pro one gets on, I’m sure they’ll help you. Sorreh.

Attack your particle in OnEquip. You are creating the effect every frame.


ITEM.Name = 'Captain Unusual Full Moon'
ITEM.Price = 150000
ITEM.Model = 'models/player/items/soldier/soldier_officer.mdl'
ITEM.Attachment = 'eyes'
ITEM.AllowedUserGroups = { "superadmin" }

function ITEM:OnEquip(ply, modifications, model)
	ply:PS_AddClientsideModel(self.ID)
	local bone = ply:LookupBone("ValveBiped.Bip01_Head1")
	ParticleEffectAttach("unusual_fullmoon_cloudy",PATTACH_ABSORIGIN_FOLLOW,bone,0)
end

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

function ITEM:ModifyClientsideModel(ply, model, pos, ang)
	model:SetModelScale(1.1, 0)
	pos = pos + (ang:Forward() * -5)
	
	return model, pos, ang
end


still problem noone see it
particle not spam right now but i got new problem

http://img841.imageshack.us/img841/755/kcj4.jpg

particle pos at (0, 0, 0)

You can’t attach particles directly to the bones. Only to attachents in player models.

Also why don’t you use model in “OnEquip”?



function ITEM:OnEquip(ply, modifications, model)
	ply:PS_AddClientsideModel(self.ID)
	ParticleEffectAttach("unusual_fullmoon_cloudy",PATTACH_ABSORIGIN_FOLLOW,model,0)
end


still problem
particle at (0,0,0) :<

Replace model with ply and 0 with attachment id. I can’t tell you which attachment id is head, so you will have to use LookupAttachment by name of “eyes” or “forward”.

Thank you
I’ll try

You can also use anim_attachment_head



function GetOurAttachment(ply) 
	local ID = ply:LookupAttachment("anim_attachment_head")
	return ply:GetAttachment( ID ) 
end 
	 
function GetHeadPos()
	LocalPlayer():ChatPrint("The attachid of your head is: "..tostring(GetOurAttachment(LocalPlayer())).."!")
end
concommand.Add("attachid",GetHeadPos)


I’m trying to find attachment id but I got it


] attachid
The attachid of your head is: table: 0x3b81c1d8!
] attachid 
The attachid of your head is: table: 0x378de1c8!
] attachid 
The attachid of your head is: table: 0x3544a4c8!
] attachid 
The attachid of your head is: table: 0x39b36528!
] attachid 
The attachid of your head is: table: 0x344bb850!
] attachid 
The attachid of your head is: table: 0x283f42f0!
] attachid 
The attachid of your head is: table: 0x3684c978!


Help me

GetAttachment returns a table with a Pos and Ang value.

Thank you I know attachment id right now
attachment id head is 7


ITEM.Name = 'Captain Unusual Full Moon'
ITEM.Price = 150000
ITEM.Model = 'models/player/items/soldier/soldier_officer.mdl'
ITEM.Attachment = 'eyes'
ITEM.AllowedUserGroups = { "superadmin" }
game.AddParticles("particles/item_fx.pcf")
PrecacheParticleSystem("unusual_fullmoon_cloudy")
function ITEM:OnEquip(ply, modifications, model)
	ply:PS_AddClientsideModel(self.ID)
	local particle = ParticleEffectAttach("unusual_fullmoon_cloudy",PATTACH_ABSORIGIN_FOLLOW,ply,7)
end

function ITEM:DoPlayerDeath(ply, particle)
	particle:StopParticles()
end

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

function ITEM:ModifyClientsideModel(ply, model, pos, ang)
	model:SetModelScale(1.1, 0)
	pos = pos + (ang:Forward() * -5)
	
	return model, pos, ang
end


oh my god why :<

http://img571.imageshack.us/img571/9964/t89k.jpg

[editline]1st September 2013[/editline]

Look it up each time instead of relying on it being the same id for all models