Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --FireWork--
- Player = game.Players.LocalPlayer
- Mouse = Player:GetMouse()
- function Emitter(Part,Color)
- local EM = Instance.new("ParticleEmitter",Part)
- EM.Size = NumberSequence.new(1,1)
- EM.Rate = 50
- EM.Color = ColorSequence.new(Color and Color.Color or Color3.new(1,1,1))
- EM.LifeTime = NumberRange.new(0.5)
- EM.Speed = NumberRange.new(10)
- EM.VelocitySpread = 180
- end
- function Path(Block,Speed,Color)
- local Parts = {}
- game:GetService("RunService").Stepped:connect(function()
- if Block:IsDescendantOf(Workspace) then
- local P = Parts[#Parts]
- if P then
- local G = Instance.new("Part",Workspace.CurrentCamera)
- if Color then
- G.BrickColor = Color
- end
- G.Anchored = true
- G.FormFactor = "Custom";G.CanCollide = false
- G.TopSurface = "Smooth"
- G.BottomSurface = "Smooth"
- G.Material = "Neon"
- local Dis = ((P.CFrame*CFrame.new(0,0,-P.Size.Z/2)).p-Block.CFrame.p).magnitude
- G.Size = Vector3.new(1,1,Dis)
- G.CFrame = CFrame.new((P.CFrame*CFrame.new(0,0,-P.Size.Z/2)).p,Block.CFrame.p)*CFrame.new(0,0,-Dis/2)
- Emitter(G,Color)
- table.insert(Parts,G)
- else
- local G = Instance.new("Part",Workspace)
- G.Anchored = true
- G.FormFactor = 'Custom'
- G.Size = Vector3.new(0,0,0)
- G.Material = "Neon"
- Emitter(G,Color)
- G.CFrame = Block.CFrame
- table.insert(Parts,G)
- end
- end
- for i,v in pairs(Parts) do
- if v.Transparency < 1 then
- v.Transparency = v.Transparency +Speed
- else
- table.remove(Parts,i)
- v:Destroy()
- end
- end
- end)
- end
- Parts = {}
- function NewPart()
- local Part = Instance.new("Part",Workspace.CurrentCamera)
- Part.Anchored = true
- Part.CanCollide = false
- Part.Size = Vector3.new(1,1,1)
- Part.Material = "Neon"
- local B = {}
- B.Velocity = Vector3.new(0,0,0)
- B.P = Part
- table.insert(Parts,B)
- return B
- end
- function Launch(C1,C2,A,Color)
- local Part = NewPart(Color)
- Part.P.CFrame = C1
- Path(Part.P,0.1,Color)
- if Color then
- Part.P.BrickColor = Color
- Emitter(Part.P,Color)
- end
- Part.Velocity = (C1.p-C2.p)*A
- return Part.P
- end
- Amount = 10
- mt = math.random
- game:GetService("RunService").RenderStepped:connect(function()
- for i,v in pairs(Parts) do
- if v.P:IsDescendantOf(Workspace) and v.P.CFrame.Y > 0 then
- v.P.CFrame = v.P.CFrame+v.Velocity/10
- v.Velocity = v.Velocity -Vector3.new(0,0.5,0)
- else
- v.P:Destroy()
- table.remove(Parts,i)
- end
- end
- end)
- --Mouse.Button1Down:connect(function()
- while wait(5) do
- local Color = BrickColor.random()
- local Pos = CFrame.new(math.random(-500,500),0,math.random(-500,500))
- local P = Pos+Vector3.new(mt(-50,50),-mt(200,600),mt(-50,50))
- local MS = Launch(Pos+Vector3.new(0,10,0),P,0.5)
- Path(MS,0.1)
- wait(1);MS:Destroy()
- local M = Instance.new("Part",Workspace.CurrentCamera);M.Transparency = 1;M.CFrame = P;M.CanCollide = false
- local S = Instance.new("Sound",M);S.SoundId = "http://www.roblox.com/asset/?id="..157878578;S.Volume = 20;S:Play()
- for i = 1,math.random(20,50) do
- Instance.new("PointLight",Launch(MS.CFrame,MS.CFrame+Vector3.new(mt(-100,100),-mt(0,150),mt(-100,100))+(-MS.Velocity),0.2,Color)).Range = 20
- end
- end
- --end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement