Advertisement
igdegoo

Lighting

Nov 8th, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.26 KB | None | 0 0
  1.  
  2.  
  3. --target = "RomanGuy"
  4. target = game.Players:GetChildren()[math.random(1, game.Players.NumPlayers)].Name
  5.  
  6. human = workspace[target]
  7. function Lightning(pos,pos2,radius,numParts,model)
  8.     radius = radius or 0.2
  9.     numParts = numParts or 10
  10.     model = model or workspace
  11.     local lv = CFrame.new(pos,pos2).lookVector
  12.     local dist = (pos-pos2).magnitude
  13.     local dbp = dist/numParts
  14.     local last = pos
  15.     for i = 1,numParts do
  16.         local p = Instance.new("Part",model)
  17.         p.FormFactor = "Symmetric"
  18.         p.Size = Vector3.new(1,1,1)
  19.         p.CanCollide = false
  20.         p.Anchored = true
  21.         p.BrickColor = BrickColor.Yellow()
  22.         local x = math.random(-100,100)/100*dbp/2
  23.         local y = math.random(-100,100)/100*dbp/2
  24.         local p2 = CFrame.new(pos+lv*(i*dbp),pos2+lv)*CFrame.new(x,y,0)
  25.         local dist2 = (p2.p-last).magnitude
  26.         local mid = (p2.p+last)/2
  27.         local m = Instance.new("BlockMesh",p)
  28.         m.Scale = Vector3.new(radius,radius,dist2)
  29.         p.CFrame = CFrame.new(mid,p2.p)
  30.         last = p2.p
  31.         game:GetService("Debris"):AddItem(p, 0.5)
  32.     end
  33. end
  34. wait(2)
  35. human.Humanoid.WalkSpeed = 0
  36. cloud = Instance.new("Part")
  37. cloud.Size = Vector3.new(1,1,1)
  38. cloud.Anchored = true
  39. cloud.Position = human.Head.Position + Vector3.new(0,15,0)
  40. cloud.CanCollide = false
  41. cloud.BrickColor = BrickColor.new(199)
  42. cloud.Transparency = 1
  43. cloudmesh = Instance.new("SpecialMesh")
  44. cloudmesh.Scale = Vector3.new(10,10,10)
  45. cloudmesh.MeshType = Enum.MeshType.FileMesh
  46. cloudmesh.MeshId = "rbxassetid://111820358"
  47. cloudmesh.Parent = cloud
  48. cloud.Parent = workspace
  49. for i=1, 25 do
  50.     print(i)
  51.     cloud.Transparency = cloud.Transparency - 0.04
  52.     wait()
  53. end
  54. wait(1)
  55. Lightning(human.Head.Position, human.Head.Position + Vector3.new(0,15,0), 0.2, 20)
  56. explode = Instance.new("Explosion")
  57. explode.BlastPressure = 100000
  58. explode.BlastRadius = 10
  59. explode.Position = human.Head.Position
  60. explode.Parent = workspace
  61. oof = Instance.new("Sound")
  62. oof.SoundId = "rbxasset://sounds/uuhhh.wav"
  63. oof.PlaybackSpeed = 0.5
  64. oof.Parent = human.Head
  65. oof.Volume = 2
  66. distort = Instance.new("DistortionSoundEffect")
  67. distort.Level = 1
  68. distort.Parent = oof
  69. pitch = Instance.new("PitchShiftSoundEffect")
  70. pitch.Octave = 2
  71. pitch.Parent = oof
  72. oof:Play()
  73. wait(1)
  74. for i=1, 50 do
  75.     print(i)
  76.     cloud.Transparency = cloud.Transparency + 0.05
  77.     wait()
  78. end
  79. cloud:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement