Trying to Create a random rain system with dynamic clouds

  1. What do you want to achieve?
    I am trying to make a random rain system using dynamic clouds. When The Rain Starts to fall, I would like the dynamic clouds to turn into rain clouds (Density 1 and cover 1)
  2. What is the issue?
    Everything works properly except for the clouds. This is my first time trying to get the clouds to work through a script so I’m pretty lost right now
  3. What solutions have you tried so far?

I have been following along with this article - Clouds | Roblox Creator Documentation
while scripting. But nothing seems to work.

Here is the script I have so far:

local clouds = Instance.new(“Clouds”)

clouds.Enabled = true

clouds.Color = Color3.new(108,108,108)

clouds.Cover = 1

clouds.Parent = game.Workspace.Terrain

(This is just the cloud part of the script)

Full Script with Demonstration on what’s wrong: Full Script And Issue

Any Ideas On How I Could Get this to work?

2 Likes

Sorry to be late but I’ve created a modified version of the script
(by the way you were using a different symbol for a string format byte:226)

local clouds = Instance.new("Clouds")
local CloudColor=Color3.fromRGB(186, 186, 186)
local RainColor=Color3.fromRGB(57, 57, 57)
local SunColor=Color3.fromRGB(255, 255, 255)
local function TweenClouds(Cloud,Prop,Time)
	return game.TweenService:Create(workspace.Terrain.Clouds,TweenInfo.new(Time,Enum.EasingStyle.Linear),Prop):Play()
end
local function SetRain()
	local s=math.random(1,3)
	local IsGonnaRain=s==3
	local Sun=s==2
	if IsGonnaRain then
		TweenClouds(clouds,{Color=RainColor,Cover=0.891},10)
	elseif Sun then
		TweenClouds(clouds,{Color=CloudColor,Cover=0.7},10)
	else
		TweenClouds(clouds,{Color=CloudColor,Cover=0.7},10)
	end
end
clouds.Enabled = true
clouds.Color = CloudColor
clouds.Cover = 0.7
clouds.Parent = game.Workspace.Terrain

SetRain()
spawn(function()
	while wait(13) do
		SetRain()
	end
end)

Thanks so much! I’ll try and see if I can get this to work.

Edit: I’m also a bit late lol