Advertisement
Guest User

Untitled

a guest
May 27th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Bolt = coroutine.wrap(function()
  2. Bolt = Instance.new("Part") Bolt.BrickColor = BrickColor.new("Bright yellow") Bolt.Transparency = .5 Bolt.TopSurface = "Smooth" Bolt.BottomSurface = "Smooth" Bolt.FormFactor = "Custom" function Lightning(PointA,PointB) local Model = Instance.new("Model",Workspace) local size = math.random(10) local direction = math.random(2) local zigzag = 0 while size < PointB - PointA.y do wait() zigzag = zigzag+1 local Bolt2 = Bolt:Clone() Bolt2.Parent = Model Bolt2.Size = Vector3.new(.1,size,.1) Bolt2.CFrame = PointA * CFrame.new(0, (Bolt2.Size.X/2)-0.5, 0) * CFrame.Angles(direction ==1 and (zigzag%2 == 0 and math.rad(45) or math.rad(-45)) or 0,math.pi/2,direction ==2 and (zigzag%2 == 1 and math.rad(45) or math.rad(-45)) or 0) * CFrame.new(0, (Bolt2.Size.X/2)+0.5, 0) PointA = Bolt2.CFrame * CFrame.new(0,Bolt2.Size.y/2,0) size = math.random(10) end local Bolt2 = Bolt:Clone() Bolt2.Parent = Model Bolt2.Size = Vector3.new(.1,PointB-PointA.y,.1) Bolt2.CFrame = PointA * CFrame.new(0,-(PointA.y-PointB)/2,0) end Lightning(CFrame.new(0,0,0),100) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement