Particles on players

Is it possible to add emitters to a player in single player

You could set the pos of it where the player is?

[lua]PlayerPos = ply:GetPos()

SomePartical:SetPos( PlayerPos )[/lua]

If i were in single player and trying to do this this is what i have so far
[lua]function playeremitting()

local players = player.GetAll() – only way i know of getting the player

for v , k ipairs ( players) do

local centr = players:GetPos() – wont work
local em = ParticleEmitter(centr)
local part = em:Add(“sprites/light_glow02_add”,centr)
if part then
part:SetColor(math.random(255),math.random(255),math.random(255),math.random(255))
part:SetVelocity(Vector(math.random(-1,1),math.random(-1,1),math.random(-1,1)):GetNormal() * 20)
part:SetDieTime(10)
part:SetLifeTime(0)
part:SetStartSize(10)
part:SetEndSize(5)

return true

end
timer.Simple( .1, playeremitting )
end
end
hook.Add( “PlayerSpawn”, “PlayerParticles”, playeremitting )
[/lua]

[lua]function playeremitting()

local players = player.GetAll()
for k , v in pairs( players ) do
	local centr = v:GetPos()
	local em = ParticleEmitter(centr)
	local part = em:Add("sprites/light_glow02_add",centr)
	if part then
		part:SetColor(math.random(255),math.random(255),math.random(255),math.random(255))
		part:SetVelocity(Vector(math.random(-1,1),math.random(-1,1),math.random(-1,1)):GetNormal() * 20)
		part:SetDieTime(10)
		part:SetLifeTime(0)
		part:SetStartSize(10)
		part:SetEndSize(5)
		return true
	end
timer.Simple( .1, playeremitting )
end

end
hook.Add( “PlayerSpawn”, “PlayerParticles”, playeremitting )[/lua]

thanks a bunch :slight_smile:

Hook ‘PlayerParticles’ Failed: autorun/server/playerparticle.lua:6: attempt to call global ‘ParticleEmitter’ (a nil value)