I'm trying to put ents.Create("point_tesla") on an entity with these KeyValues
teslabolt:SetKeyValue("texture", "trails/laser.vmt")
teslabolt:SetKeyValue("m_Color", "255 255 255")
teslabolt:SetKeyValue("m_flRadius", 48)
teslabolt:SetKeyValue("interval_min", 1.5)
teslabolt:SetKeyValue("beamcount_min", 14.60)
teslabolt:SetKeyValue("thick_min", 6)
teslabolt:SetKeyValue("lifetime_max", 2)
I also don't want it(the particle effect) to stop until the player touches the entity because that's when the entity I created gets removed anyway.
Can someone give me an example of how you'd do that and then call it clientside?
Bump:
I'm using the examples from: Particle effect tutorial?
but whenever I spawn my entity the particles show up as pink squares but there's another addon I have that uses the exact same material which seems to be default. Can anyone help me?
init.lua (effects/CoolSpark)
effect:local teslabolt = EffectData()
teslabolt:SetOrigin(self.Entity:GetPos())
teslabolt:SetEntity(self.Entity)
teslabolt:SetKeyValue("targetname","scav_universal")
teslabolt:SetKeyValue("texture", "trails/laser.vmt")
teslabolt:SetKeyValue("m_Color", "255 255 255")
teslabolt:SetKeyValue("m_flRadius", 48)
teslabolt:SetKeyValue("interval_min", 1.5)
teslabolt:SetKeyValue("beamcount_min", 14.60)
teslabolt:SetKeyValue("thick_min", 6)
teslabolt:SetKeyValue("lifetime_max", 2)
util.Effect("CoolSparks", teslabolt)
cl_init.lua (my entity)
function ENT:Think()
local tr = LocalPlayer():GetEyeTrace()
local pos = tr.HitPos + tr.HitNormal * 100 -- The origin position of the effect
local emitter = ParticleEmitter( pos ) -- Particle emitter in this position
for i = 0, 100 do -- Do 100 particles
local part = emitter:Add( "effects/CoolSpark", pos ) -- Create a new particle at pos
if ( part ) then
part:SetDieTime( 1 ) -- How long the particle should "live"
part:SetStartAlpha( 255 ) -- Starting alpha of the particle
part:SetEndAlpha( 0 ) -- Particle size at the end if its lifetime
part:SetStartSize( 5 ) -- Starting size
part:SetEndSize( 0 ) -- Size when removed
part:SetGravity( Vector( 0, 0, -250 ) ) -- Gravity of the particle
part:SetVelocity( VectorRand() * 50 ) -- Initial velocity of the particle
end
end
(wrapped in a Think function because I want it to keep going until the entity is removed)
Sorry, you need to Log In to post a reply to this thread.