Weather System [Open-Sourced]

I’ve opened sourced an old weather system of mine that i’m not using anymore. It was made a few years ago when I was an intermediate scripter.

This weather system includes almost everything you would need for a normal weather system. Here they are:


Lightning

Lightning is randomly generated across the map every few seconds. If lightning does strike you, it will kill you. Lightning also spawns a fire at the point of where it hit. The fire will damage you the closer you get to it. Fires also despawn after some time.


Rain

Rain is made by a part being placed over the player’s head, with a particle emitter locally. Rain will start/end smoothly as the weather changes.


Smooth transitions

When the weather changes, the lighting, audio, and rain smoothly transition into what they need to be according to the weather. There are 2 types of lighting. Lighting for rain, and lighting for daytime. You can change these to fit your liking.


Audio is also provided, although it can be easily altered to fit your needs.


Since this was created some time ago, the code isn’t the greatest, but it works.

I have open sourced the game here. You can play to try it, or edit and save it.

Credits to sleitnick for his camera shake module!

If you have any questions or enquiries, feel free to message me on discord DataAspect#7209 or contact me through the developer forum!

63 Likes

Im playing the game right now, the weather system is awesome. I have 2 recommendations though, it gets a bit too blue when it rains, its a nice detail but its a bit too strong. Another thing is that the shake from the thunder is a bit too smooth or slow. Id recommend making it more sharp or stronger.

Other than that, great weather system!

7 Likes

Wow, this is beautiful. Love the sounds and sky and ambiance lighting as the weather changes. Just a quick question. Is it possible (or what would I change) to adjust hot often and how long a storm happens? For instance they come and go to often and so quick. I was hoping to make it happen less often but last longer when it does come. Thank you!

4 Likes

You would first open the weather module inside serverscriptservice.

Screen Shot 2021-04-11 at 4.18.43 PM

Screen Shot 2021-04-11 at 4.18.58 PM

You should then see this at the top of the script.

To change how long the day lasts, edit those numbers inside of the DayTimes table. For example if you would want it to last 2 minutes, put 120 for both of them. Same with the RainTimes.

Screen Shot 2021-04-11 at 4.21.42 PM

Here, the day will last for 2 minutes before changing to rain.

If you want it to be random, as in the day and rain last a random amount of time, you would put the MinTime as the lowest possible time, and the MaxTime as the most time.

For example here, the day will last anywhere from a minute, to 2 minutes. (It will randomly pick a number.)

Screen Shot 2021-04-11 at 4.22.51 PM

7 Likes

Thank you so much! This is awesome!

5 Likes

I really like this. Do you know how i would change the lightning color?

Thanks!

3 Likes

Screen Shot 2021-04-12 at 8.27.59 AM

The lightning uses this electrode part. You can change the properties of this part to what you want the lightning’s properties to be.

5 Likes

Woah! I will definitely be using this in my next project. It almost looks like jailbreak’s weather system which I love!

3 Likes

Very nice weather system,the ambience and effects are just on point!

5 Likes

i joined the game and it looks quite nice. the lightning looks epic as well. im going to 100% use this in my other project. thankss!!!

3 Likes

Hi do you know how to change how much lightning bolts come out of a lightning?

2 Likes

Sorry for the late response.

Go into that script and change the 3 to whatever number you like.

3 Likes

Can I have your codes theme colors? lol

3 Likes

Sure! Here you go.

Screen Shot 2021-04-16 at 7.12.48 PM

4 Likes

Much appreciated it! I really like this colour scheme you’ve got going on!

3 Likes

hi sorry for asking but how would i change the sound of day time and sound of the rain? i tried looking in all the scripts. also where are those scripts for the lightning?

1 Like

All the sounds are located in ServerStorage. Just change the sound ids.

1 Like

Decided to update this system and add something cool.

Added a lightning strike command, which allows you to lightning strike anyone in the server. Just type the command below in chat with ‘PlayerName’ being the name of your victim.

/Strike PlayerName

In the current game, everyone has permissions to strike anyone. However you can edit the script to add and remove people who you want to have these commands. To activate this, simply delete the part that says

table.insert(AllowedUsers,Player.Name)

Screen Shot 2021-05-01 at 11.11.55 AM

If someone is striking you too much, you can always play in the studio version.

6 Likes

Is this nighttime compatible too?

Like, during the night, storms can also occur

3 Likes