Advertisement
ConTheKoala

Rain again

Jul 11th, 2017
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. local dropheight = 200 --Set this to the height in which the raindrops will spawn at
  2. droprate1 = 4 -- for example, if I put "2" here, and "5" below, then it would have a 2 out of 5 chance of dropping a raindrop.
  3. droprate2 = 5
  4. waittime = 0.1
  5. function Rain()
  6. local drop = Instance.new("Part", Workspace)
  7. drop.Name = "RainDrop"
  8. drop.BrickColor = BrickColor.new("Bright blue")
  9. drop.Transparency = 0.5
  10. drop.Reflectance = 0.4
  11. drop.Position = Vector3.new( math.random(-8, 15) , dropheight , math.random(-14, 4))
  12. drop.FormFactor = "Custom"
  13. drop.Shape = "Block"
  14. drop.Size = Vector3.new(0.2, 0.65, 0.2)
  15. drop.Elasticity = 0 -- We wouldn't want raindrops bouncing would we?
  16. drop.Anchored = false
  17. drop.CanCollide = false -- Raindrops aren't solids! If they were, raining would be the most common natural disaster.
  18. local s = script.DropScript:clone()
  19. s.Parent = drop
  20. s.Disabled = false
  21. end
  22.  
  23. while true do
  24. m = math.random(1, droprate2)
  25. if m <= droprate1 then
  26. wait(waittime)
  27. Rain()
  28. else
  29. print("No rain!")
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement