Advertisement
HowToRoblox

WeatherHandler

Sep 15th, 2020 (edited)
7,882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local weatherTypes = game.ServerStorage:WaitForChild("WeatherTypes"):GetChildren()
  2.  
  3. table.insert(weatherTypes, "nothing")
  4.  
  5.  
  6. while wait(math.random(10, 100)) do
  7.    
  8.    
  9.     local chosenWeather = weatherTypes[math.random(#weatherTypes)]
  10.    
  11.    
  12.     if chosenWeather ~= "nothing" then
  13.        
  14.         local chosenWeatherClone = chosenWeather:Clone()
  15.         chosenWeatherClone.Parent = workspace
  16.        
  17.         wait(math.random(10, 60))
  18.        
  19.         chosenWeatherClone:Destroy()
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement