Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local LIFETIME = math.random(0.2, 0.3)
- function EFFECT:Init(data)
- self.StartPos = data:GetStart()
- self.EndPos = data:GetOrigin()
- self.Dir = self.EndPos - self.StartPos
- self:SetRenderBoundsWS( self.StartPos, self.EndPos )
- self.DieTime = CurTime() + LIFETIME
- local emitter = ParticleEmitter(self.StartPos)
- for i=1, math.random(4) do
- local particle = emitter:Add("sprites/light_glow02_add",self.StartPos)
- if particle then
- particle:SetColor(0,255,0,255)
- particle:SetVelocity(Vector(math.random(-1,1),math.random(-1,1),math.random(-1,1)):GetNormal() * 20)
- timer.Simple(0.25, function()
- particle:SetVelocity(Vector(math.random(-1,1),math.random(-1,1),math.random(-1,1)):GetNormal() * 20)
- end)
- particle:SetDieTime(LIFETIME)
- particle:SetLifeTime(2)
- particle:SetStartSize(5)
- particle:SetEndSize(1)
- end
- end
- end
- function EFFECT:Think()
- return true
- end
- function EFFECT:Render()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement