Advertisement
ThatOneScript

Untitled

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