Advertisement
MLGMatthew

ROBLOX rain script

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