Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1.  
  2. print ("Storm Loaded")
  3.  
  4. function doThunder()
  5. local storm_sound = nil
  6. if math.random() < .5 then
  7. storm_sound = game.Workspace:findFirstChild("ThunderSound")
  8. if storm_sound == nil then
  9. storm_sound = Instance.new("Sound")
  10. storm_sound.Name = "ThunderSound"
  11. storm_sound.SoundId = "rbxasset://sounds\\HalloweenThunder.wav"
  12. storm_sound.Parent = game.Workspace
  13. end
  14. else
  15. storm_sound = game.Workspace:findFirstChild("LightningSound")
  16. if storm_sound == nil then
  17. storm_sound = Instance.new("Sound")
  18. storm_sound.Name = "LightningSound"
  19. storm_sound.SoundId = "rbxasset://sounds\\HalloweenLightning.wav"
  20. storm_sound.Parent = game.Workspace
  21. end
  22. end
  23.  
  24. storm_sound:play()
  25. end
  26.  
  27. function MakeMeteor()
  28. local m = Instance.new("Part")
  29. m.Shape = math.random(0,1)
  30. local s = math.random(4, 30)
  31.  
  32. m.Size = Vector3.new(s,s,s)
  33. m.BottomSurface = 0
  34. m.TopSurface = 0
  35. m.BrickColor = BrickColor.Random()
  36.  
  37. m.CFrame = CFrame.new(Vector3.new(math.random(-90,90), math.random(400,800), math.random(-90, 90)), Vector3.new(math.random(), math.random(), math.random()))
  38.  
  39.  
  40. local b = Instance.new("BodyForce")
  41. b.Parent = m
  42. b.force = Vector3.new(0, m:GetMass() * 120, 0)
  43.  
  44.  
  45. m.Parent = game.Workspace
  46.  
  47. end
  48.  
  49. function MakeSticks()
  50.  
  51. local m = Instance.new("Part")
  52. m.Shape = 1
  53. local s = math.random(20, 100)
  54. local w = math.random(2,4)
  55. m.Size = Vector3.new(w,s,w)
  56. m.BottomSurface = 0
  57. m.TopSurface = 0
  58. m.BrickColor = BrickColor.Random()
  59.  
  60. m.CFrame = CFrame.new(Vector3.new(math.random(-90,90), math.random(400,800), math.random(-90, 90)), Vector3.new(10*(math.random()-.5), 10 * (math.random()-.5), 10 * (math.random()-.5)))
  61.  
  62.  
  63. local b = Instance.new("BodyForce")
  64. b.Parent = m
  65. b.force = Vector3.new(0, m:GetMass() * 120, 0)
  66.  
  67.  
  68. m.Parent = game.Workspace
  69. end
  70.  
  71. while true do
  72. wait(math.random(5,35))
  73.  
  74. local n = math.random(1,7)
  75. local t = math.random(0,1)
  76.  
  77. for i = 1,n do
  78. doThunder()
  79. if t == 0 then MakeMeteor() else MakeSticks() end
  80. wait(math.random() * 3)
  81. end
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement