NYXRBLX

Untitled

Sep 9th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. cols = {"Bright yellow", "Bright green", "Bright blue", "Bright red"}
  2.  
  3. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  4. part.Parent = parent
  5. part.formFactor = form
  6. part.CanCollide = collide
  7. part.Transparency = tran
  8. part.Reflectance = ref
  9. part.Size = Vector3.new(x,y,z)
  10. part.BrickColor = BrickColor.new(color)
  11. part.TopSurface = 0
  12. part.BottomSurface = 0
  13. part.Anchored = anchor
  14. part.Locked = true
  15. part:BreakJoints()
  16. end
  17.  
  18. function weld(w, p, p1, a, b, c, x, y, z)
  19. w.Parent = p
  20. w.Part0 = p
  21. w.Part1 = p1
  22. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  23. end
  24.  
  25.  
  26. function modelfirework(pos, color)
  27. local fw = Instance.new("Model")
  28. fw.Name = "xSFireWorks"
  29. local stick = Instance.new("Part")
  30. prop(stick, fw, true, 0, 0, 0.3, 1.6, 0.3, "Reddish brown", false, "Custom")
  31. stick.CFrame = CFrame.new(pos) * CFrame.Angles(math.random(-60,60)/100,math.random(-32,32)/10,math.random(-60,60)/100)
  32.  
  33. local main = Instance.new("Part")
  34. prop(main, fw, true, 0, 0, 0.8, 1.8, 0.8, color, false, "Custom")
  35. main.CFrame = stick.CFrame
  36. Instance.new("CylinderMesh",main)
  37.  
  38. local mw = Instance.new("Weld")
  39. weld(mw, stick, main, 0, 0, 0, 0.4, -0.9, 0)
  40.  
  41. local tip = Instance.new("Part")
  42. prop(tip, fw, true, 0, 0, 0.8, 0.6, 0.8, color, false, "Custom")
  43. tip.CFrame = main.CFrame
  44. local s = Instance.new("SpecialMesh",tip)
  45. s.MeshId = "http://www.roblox.com/asset/?id=1033714"
  46. s.Scale = Vector3.new(0.41,0.85,0.41)
  47.  
  48. local tw = Instance.new("Weld")
  49. weld(tw, main, tip, 0, 0, 0, 0, -1.2, 0)
  50.  
  51. local teq = Instance.new("Part")
  52. prop(teq, fw, true, 0, 0, 0.2, 0.5, 0.2, color, false, "Custom")
  53. teq.CFrame = main.CFrame
  54.  
  55. local ew = Instance.new("Weld")
  56. weld(ew, main, teq, 0, 0, 0, 0, 1.05, 0.3)
  57.  
  58. local bp = Instance.new("BodyPosition",main)
  59. bp.P = 4500
  60. bp.position = main.Position
  61. bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  62.  
  63. local bg = Instance.new("BodyGyro",main)
  64. bg.P = 20000
  65. bg.cframe = CFrame.new(main.Position, main.CFrame * CFrame.new(0,0,-2).p)
  66. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  67.  
  68. fw.Parent = workspace
  69.  
  70. return fw, main, stick, teq, mw, bp, bg
  71. end
  72.  
  73. launch = function(pos, color, distance, speed)
  74. local model, main, stick, teq, mw, bp, bg = modelfirework(pos, color)
  75. wait(0.5)
  76. local f = Instance.new("Fire",teq)
  77. f.Size = 0
  78. f.Heat = -5
  79. wait(0.5)
  80. for i=-5,-25,-0.4 do
  81. wait()
  82. f.Heat = i
  83. end
  84. wait(0.8)
  85. mw:remove()
  86. stick:remove()
  87. local p = main.CFrame
  88. for i=0,distance,speed do
  89. bp.position = p * CFrame.new(0,i,0).p
  90. wait()
  91. end
  92. model:remove()
  93. return bp.position
  94. end
  95.  
  96. fires = {
  97. function(pos, color, dist, speed)
  98. local boompos = launch(pos, color, dist, speed)
  99. for i=0,360,20 do
  100. local p = Instance.new("Part")
  101. prop(p, workspace, false, 1, 0, 1, 1, 1, 1, false, "Brick")
  102. p.CFrame = CFrame.new(boompos) * CFrame.Angles(0,math.rad(i),0)
  103. p.Velocity = p.CFrame.lookVector * 180
  104. local r, g, b = math.random(0,1), math.random(0,1), math.random(0,1)
  105. Instance.new("Fire",p).Color = Color3.new(r,g,b)
  106. end
  107. end,
  108. function(pos, color, dist, speed)
  109. local boompos = launch(pos, color, dist, speed)
  110. for i=0,360,20 do
  111. local p = Instance.new("Part")
  112. prop(p, workspace, false, 1, 0, 1, 1, 1, 1, false, "Brick")
  113. p.CFrame = CFrame.new(boompos) * CFrame.Angles(0,math.rad(i),0) * CFrame.new(0,0,-2)
  114. local poz = p.CFrame
  115. local r, g, b = math.random(0,1), math.random(0,1), math.random(0,1)
  116. Instance.new("Fire",p).Color = Color3.new(r,g,b)
  117. local bp = Instance.new("BodyPosition",p)
  118. bp.P = 10000
  119. bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  120. bp.position = p.Position
  121. coroutine.resume(coroutine.create(function()
  122. for i=0,720, 16 do
  123. bp.position = poz * CFrame.Angles(0,math.rad(i),0) * CFrame.new(0,0,i/4).p
  124. wait()
  125. end
  126. p:remove()
  127. end))
  128. end
  129. end
  130. }
  131.  
  132. for i=1,15 do
  133. local rand = math.random(1,#fires)
  134. coroutine.resume(coroutine.create(function()
  135. fires[rand](Vector3.new(math.random(-200,200),3,math.random(-200,200)), cols[math.random(1,#cols)], math.random(180,300), math.random(150,300)/100)
  136. end))
  137. wait(math.random(40,100)/10)
  138. end
Add Comment
Please, Sign In to add comment