Advertisement
Guest User

Untitled

a guest
Oct 30th, 2021
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. function EFFECT:Init(data)
  2.     if data:GetEntity():IsValid() then
  3.         local ent = data:GetEntity()
  4.         local StartPos = ent:GetPos()
  5.  
  6.         self.Emitter = ParticleEmitter(StartPos)
  7.  
  8.         for i = 1, 100 do
  9.             local p = self.Emitter:Add("effects/splash"..math.random(1,2), StartPos)
  10.                
  11.             p:SetDieTime(4)
  12.             p:SetStartAlpha(255)
  13.             p:SetEndAlpha(0)
  14.             p:SetStartSize(math.Rand(120, 240))
  15.             p:SetEndSize(math.Rand(240,480))
  16.             p:SetColor(255, 250, 250)
  17.                
  18.             p:SetVelocity(Vector(math.Rand(-250,250),math.Rand(-250,250),math.Rand(200,2500)))
  19.             p:SetGravity(Vector(0, 0, -350))
  20.             p:SetCollide(true)
  21.  
  22.             p:SetCollideCallback(function(part,hitpos,normal)
  23.                 local effdata = EffectData()
  24.                     effdata:SetOrigin(hitpos)
  25.                     util.Effect("watersplash",effdata)
  26.  
  27.             end)
  28.         end
  29.  
  30.         for i = 1, 100 do
  31.             local p = self.Emitter:Add("effects/bubble", StartPos)
  32.                
  33.             p:SetDieTime(2)
  34.             p:SetStartAlpha(255)
  35.             p:SetEndAlpha(0)
  36.             p:SetStartSize(math.Rand(5, 10))
  37.             p:SetEndSize(10)
  38.             p:SetColor(255, 250, 250)
  39.                
  40.             p:SetVelocity(VectorRand() * 1200)
  41.             p:SetCollide(true)
  42.  
  43.         end
  44.  
  45.  
  46.  
  47.         for i = 1, 1 do
  48.             local p = self.Emitter:Add("effects/splashwake3",StartPos)
  49.             p:SetDieTime(1)
  50.             p:SetStartAlpha(255)
  51.             p:SetEndAlpha(0)
  52.             p:SetStartSize(400)
  53.             p:SetEndSize(2000)
  54.             p:SetColor(255, 250, 250)
  55.             p:SetAngles(AngleRand())
  56.             p:SetCollide(true)
  57.  
  58.  
  59.         end
  60.  
  61.         for i = 1, 1 do
  62.             local p = self.Emitter:Add("effects/splashwake1",StartPos)
  63.             p:SetDieTime(1)
  64.             p:SetStartAlpha(255)
  65.             p:SetEndAlpha(0)
  66.             p:SetStartSize(200)
  67.             p:SetEndSize(1200)
  68.             p:SetColor(255, 250, 250)
  69.             p:SetCollide(true)
  70.  
  71.  
  72.         end
  73.  
  74.         self.Emitter:Finish()
  75.     end
  76. end
  77.  
  78.  
  79. function EFFECT:Render()
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement