How can I make a random rain system that incorporates dynamic skies/clouds?

I saw Cyanitem recently post a sneak for his game, Bushido, where he created a rain system that uses dynamic clouds. I was wondering how I could achieve this effect?

Cyanitem’s system (youtube link due to file being too large for upload on roblox

1 Like

I’m somewhat of a new scripter, so sorry in advance.

If I’m correct, you’d need to use some sort of RNG to generate how often you want rain. Then, you could do something that changes the values of the clouds in a “while true do” loop.

Here’s an article:
https://developer.roblox.com/en-us/articles/Loops

I can also give you something basic to work off of:

local clouds = Instance.new("Clouds")
clouds.Parent = game.Workspace.Terrain
clouds.Enabled = true
clouds.Cover = 0
clouds.Density = 0

wait(3)
	for i = 0,1,.001 do
		clouds.Cover = i
		clouds.Density = i
		wait(.0001)
		if clouds.Cover == 1 then
			break
	end
end

This basically starts a loop, which then adds 0.001 to the density value of the clouds every 0.0001 seconds. Then, once the clouds reach a density of 1, the loop will break, and your clouds remain at density of 1.

Hoped this helped. Sorry, I don’t know much about math.random or RNG.

Edit: Forgot about the rain.

Once you’re done with the cloud density, make it so that if the cloud density is 1, or higher, a particle emitter will become enabled.

1 Like