Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local debree = game:GetService("Debris")
- local tweens = game:GetService("TweenService")
- local function AddDmg(Part, Damage)
- local canddmg = true
- Part.Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if canddmg then
- if hum == nil then
- hum = hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- canddmg = false;hum:TakeDamage(Damage)
- end
- else
- canddmg = false;hum:TakeDamage(Damage)
- end
- end
- end)
- end
- local function boltEffect(Start, Finish, Length, Spread, Time, Bolts, Pillar, DelayAnim, Aoe)
- local points = {}
- local tinfo = TweenInfo.new(Time)
- local p = Instance.new("Part")
- p.Anchored = true
- p.CanCollide = false
- p.CastShadow = false
- p.Locked = true
- p.Massless = true
- p.Transparency = math.random(-0.1,0.8)
- p.BrickColor = BrickColor.new("Medium blue")
- p.Material = Enum.Material.Neon
- p.Size = Vector3.new(1,1,1)
- for i = 0, Length do
- local j = math.random(1,Spread) -- spread
- local offset = Vector3.new(math.random(-j,j),math.random(-j,j),math.random(-j,j))
- local position = Start + (Finish - Start).Unit*i*(Finish - Start).Magnitude/Length
- local folder = workspace:FindFirstChild("Debree")
- if i == 0 or i == Length then
- offset = Vector3.new(0,0,0)
- if folder == nil then
- Instance.new("Folder",workspace).Name = "Debree"
- folder = workspace:FindFirstChild("Debree")
- end
- if i == Length then
- local pe = p:Clone()
- pe.Shape = Enum.PartType.Ball
- pe.Position = Finish
- pe.Parent = folder
- pe.Name = "Ball"
- local g = {}
- g.Size = Vector3.new(15,15,15)
- g.Transparency = 1
- g.Color = Color3.fromHSV(0.5, 0.5, 1)
- tweens:Create(pe,TweenInfo.new(Time),g):Play()
- end
- end
- points[#points + 1] = position + offset
- end
- spawn(function()
- if Pillar == true then
- local bolt = {}
- for i = 0, Length do
- local position = Start + (Finish - Start).Unit*i*(Finish - Start).Magnitude/Length
- bolt[#bolt + 1] = position
- end
- for i = 1, #bolt do
- if bolt[i + 1] ~= nil then
- local color = BrickColor.new()
- local m = math.random(1,2)
- local folder = workspace:FindFirstChild("Debree")
- if folder == nil then
- Instance.new("Folder",workspace).Name = "Debree"
- folder = workspace:FindFirstChild("Debree")
- end
- if m == 1 then
- color = BrickColor.new("Pastel Blue")
- else
- color = BrickColor.new("Medium blue")
- end
- local pa = p:Clone()
- pa.Size = Vector3.new(0.5,0.5, (bolt[i] - bolt[i + 1]).Magnitude)
- pa.CFrame = CFrame.new((bolt[i] + bolt[i + 1])/2, bolt[i + 1])
- pa.BrickColor = color
- pa.Name = "Pillar"
- pa.Parent = folder
- local g = {}
- g.Size = Vector3.new(1,1,pa.Size.Z)
- g.Transparency = 1
- tweens:Create(pa,TweenInfo.new(Time*1.1),g):Play()
- debree:AddItem(pa,Time*1.1)
- end
- end
- end
- for i = 1, #points do
- if points[i + 1] ~= nil then
- if DelayAnim == true then
- wait()
- end
- if Bolts <= 0 or Bolts == nil then
- Bolts = 1
- end
- for s = 1, Bolts do
- local color = BrickColor.new()
- local m = math.random(1,2)
- local folder = workspace:FindFirstChild("Debree")
- if folder == nil then
- Instance.new("Folder",workspace).Name = "Debree"
- folder = workspace:FindFirstChild("Debree")
- end
- if m == 1 then
- color = BrickColor.new("Pastel Blue")
- else
- color = BrickColor.new("Medium blue")
- end
- local pa = p:Clone()
- pa.Size = Vector3.new(1,1, (points[i] - points[i + 1]).Magnitude)
- pa.CFrame = CFrame.new((points[i] + points[i + 1])/2, points[i + 1])
- pa.BrickColor = color
- pa.Name = "Bolts"
- pa.Parent = folder
- if Aoe == true then
- AddDmg(pa,10)
- end
- local g = {}
- g.Size = Vector3.new(1.5,1.5,pa.Size.Z)
- g.Transparency = 1
- tweens:Create(pa,tinfo,g):Play()
- debree:AddItem(pa,Time)
- end
- end
- end
- end)
- end
- spawn(function()
- while wait(1) do
- boltEffect(workspace.start.Position,workspace.finish.Position,math.random(5,25),math.random(3,8),1,1,true,false,true)
- end
- end) -- thats it (this is client sided, it might work with normal scripts, i havent tested it yet tho)
- -- made by eric/Er_1x/ERIC#2073
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement