Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. local LIFETIME = math.random(0.2, 0.3)
  2.  
  3. function EFFECT:Init(data)
  4. self.StartPos = data:GetStart()
  5. self.EndPos = data:GetOrigin()
  6. self.Dir = self.EndPos - self.StartPos
  7. self:SetRenderBoundsWS( self.StartPos, self.EndPos )
  8. self.DieTime = CurTime() + LIFETIME
  9.  
  10. local emitter = ParticleEmitter(self.StartPos)
  11. for i=1, math.random(4) do
  12. local particle = emitter:Add("sprites/light_glow02_add",self.StartPos)
  13. if particle then
  14. particle:SetColor(0,255,0,255)
  15. particle:SetVelocity(Vector(math.random(-1,1),math.random(-1,1),math.random(-1,1)):GetNormal() * 20)
  16. timer.Simple(0.25, function()
  17. particle:SetVelocity(Vector(math.random(-1,1),math.random(-1,1),math.random(-1,1)):GetNormal() * 20)
  18. end)
  19. particle:SetDieTime(LIFETIME)
  20. particle:SetLifeTime(2)
  21. particle:SetStartSize(5)
  22. particle:SetEndSize(1)
  23. end
  24. end
  25. end
  26.  
  27. function EFFECT:Think()
  28. return true
  29. end
  30.  
  31. function EFFECT:Render()
  32.  
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement