Advertisement
NebulaZorua

Blood Stuff

May 18th, 2018
1,143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. -- if you use my template, you should be able to copy+paste this code in to use my new blood stuff.
  2.  
  3. local BloodPuddles = {}
  4. function Puddle(hit,pos,norm,data)
  5. local material = data.Material or Enum.Material.Glass
  6. local color = data.Color or BrickColor.new'Crimson'
  7. local size = data.Size or 1
  8.  
  9. if(hit.Name ~= 'BloodPuddle')then
  10. local Puddle = NewInstance('Part',hit,{Material=material,BrickColor=color,Size=V3.N(size,.1,size),CFrame=CF.N(pos,pos+norm)*CF.A(90*M.P/180,0,0),Anchored=true,CanCollide=false,Archivable=false,Locked=true,Name='BloodPuddle'})
  11. local Cyl = NewInstance('CylinderMesh',Puddle,{Name='CylinderMesh'})
  12. BloodPuddles[Puddle] = 0
  13. else
  14. local cyl = hit:FindFirstChild'CylinderMesh'
  15. if(cyl)then
  16. BloodPuddles[hit] = 0
  17. cyl.Scale = cyl.Scale + V3.N(size,0,size)
  18. hit.Transparency = 0
  19. end
  20. end
  21. end
  22.  
  23. function Droplet(data)
  24. --ShootBullet{Size=V3.N(3,3,3),Shape='Ball',Frames=160,Origin=data.Circle.CFrame,Speed=10}
  25. local Size = data.Size or 1
  26. local Color = data.Color or BrickColor.new'Crimson'
  27. local StudsPerFrame = data.Speed or 1
  28. local Shape = data.Shape or 'Ball'
  29. local Frames = (data.Frames or 160)+1
  30. local Pos = data.Origin or Root.CFrame
  31. local Direction = data.Direction or Root.CFrame.lookVector*100000
  32. local Material = data.Material or Enum.Material.Glass
  33. local Drop = data.Drop or .05
  34. local Ignorelist = data.Ignorelist or nil
  35.  
  36. local Bullet = Part(Effects,Color,Material,V3.N(Size,Size,Size),Pos,true,false)
  37. local BMesh = Mesh(Bullet,Enum.MeshType.Brick,"","",V3.N(1,1,1),V3.N())
  38. if(Shape == 'Ball')then
  39. BMesh.MeshType = Enum.MeshType.Sphere
  40. elseif(Shape == 'Head')then
  41. BMesh.MeshType = Enum.MeshType.Head
  42. elseif(Shape == 'Cylinder')then
  43. BMesh.MeshType = Enum.MeshType.Cylinder
  44. end
  45.  
  46. coroutine.wrap(function()
  47. for i = 1, Frames do
  48. Pos = Pos * CF.N(0,-(Drop*i),0)
  49. local hit,pos,norm,dist = CastRay(Bullet.CFrame.p,CF.N(Pos.p,Direction)*CF.N(0,0,-(StudsPerFrame*i)).p,StudsPerFrame)
  50. if(hit and (not hit.Parent or not hit.Parent:FindFirstChildOfClass'Humanoid' and not hit.Parent:IsA'Accessory'))then
  51. Puddle(hit,pos,norm,data)
  52. break;
  53. else
  54. Bullet.CFrame = CF.N(Pos.p,Direction)*CF.N(0,0,-(StudsPerFrame*i))
  55. end
  56. swait()
  57. end
  58. Bullet:destroy()
  59. end)()
  60. end
  61. coroutine.wrap(function()
  62. while true do
  63. for i,v in next, BloodPuddles do
  64. local mesh = i:FindFirstChild'CylinderMesh'
  65. BloodPuddles[i] = v + 1
  66. if(not mesh or i.Transparency >= 1)then
  67. i:destroy()
  68. BloodPuddles[i] = nil
  69. elseif(v >= Frame_Speed*4)then
  70. local trans = (v-Frame_Speed*4)/(Frame_Speed*2)
  71. i.Transparency = trans
  72. if(mesh.Scale.Z > 0)then
  73. mesh.Scale = mesh.Scale-V3.N(.05,0,.05)
  74. end
  75. else
  76. i.Transparency = 0
  77. end
  78. end
  79. swait()
  80. end
  81.  
  82. end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement