Advertisement
xXjoethebestXx

ROBLOX LIGHTNING

Mar 31st, 2015
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. script.Name = "Lol Derp"
  2. local bright = game.Lighting.Brightness
  3.  
  4. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  5. part.Parent = parent
  6. part.formFactor = form
  7. part.CanCollide = collide
  8. part.Transparency = tran
  9. part.Reflectance = ref
  10. part.Size = Vector3.new(x,y,z)
  11. part.BrickColor = BrickColor.new(color)
  12. part.TopSurface = 0
  13. part.BottomSurface = 0
  14. part.Anchored = anchor
  15. part.Locked = true
  16. part:BreakJoints()
  17. end
  18.  
  19.  
  20. function thunder(pos)
  21. local last = CFrame.new(pos)
  22. local scale = 1
  23. local lights = {}
  24. repeat
  25. local si = math.random(15,45)
  26. local p = Instance.new("Part")
  27. prop(p,workspace,true,0,0,5,si,5,"New Yeller",true,"Custom")
  28. p.CFrame = last * CFrame.new(0,-scale/2,0)
  29. p.CFrame = CFrame.new(p.Position) * CFrame.Angles(math.random(-120,120)/100,math.random(-30,30)/100,math.random(-120,120)/100) * CFrame.new(0,-si/2,0)
  30. last = p.CFrame
  31. scale = si
  32. table.insert(lights,p)
  33. until last.y < 14
  34. local ex = Instance.new("Explosion",workspace)
  35. ex.BlastRadius = 22
  36. ex.BlastPressure = 300000
  37. ex.Position = last * CFrame.new(0,-scale/2,0).p
  38. local pew = Instance.new("Sound",workspace)
  39. pew.SoundId = "rbxasset://sounds\HalloweenLightning.wav"
  40. pew.Volume = math.random(70,110)/100
  41. pew.Pitch = math.random(85,120)/100
  42. coroutine.resume(coroutine.create(function()
  43. for i=1,math.random(5,25) do
  44. if game.Lighting.Brightness == bright then
  45. game.Lighting.Brightness = 9999
  46. else
  47. game.Lighting.Brightness = bright
  48. end
  49. wait()
  50. end
  51. game.Lighting.Brightness = bright
  52. end))
  53. wait(0.05)
  54. pew:play()
  55. wait(math.random(10,80)/100)
  56. ex:remove()
  57. for _,v in pairs(lights) do
  58. coroutine.resume(coroutine.create(function()
  59. for i=0,1,0.25 do
  60. wait()
  61. v.Transparency = i
  62. end
  63. v:remove()
  64. end))
  65. end
  66. end
  67.  
  68. while true do
  69. wait(math.random(1,300)/100)
  70. coroutine.resume(coroutine.create(function()
  71. thunder(Vector3.new(math.random(-250,250),math.random(700,1000),math.random(-250,250)))
  72. end))
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement