Randomized clouds

Hello, I made a little script that randomizes clouds randomly!

It’s random in these factors:

  1. Time between changes
  2. Amount of change
  3. Amount of time that it will take to change

Its a pretty simple script and will just add a tad more realism to your game!

I would like it if you post the game you used this in below this post so i can see in what way you used it.

Want to see how it looks before you use it?
Click here!

Setup:
Workspace > Terrain > Add instance ‘Clouds’
ServerScriptService > Add instance ‘Script’

Add the following code to the script in ServerScriptService:

-- [[ Variables ]]
local ts = game:GetService("TweenService")

local clouds = game.Workspace.Terrain.Clouds

-- [[ Functions ]]
function randomwaittime()
	local rtime = math.random(30,120)
	return rtime
end

function randomtweentime()
	local rtime = math.random(5,20)
	return rtime
end

function randomcloudcover()
	local rcover = math.random(600,800)
	return "0."..rcover
end

function changeclouds(tweentime, tweencover)
	
	local tween = ts:Create(clouds, TweenInfo.new(tweentime), { Cover = tonumber(tweencover) }):Play()
end

-- [[ Main ]]
while true do
	local tweentime = randomwaittime()
	local tweencover = randomcloudcover()
	local randomwaittime = randomwaittime()
	
	changeclouds(tweentime, tweencover)
	wait(randomwaittime)
end

Enjoy using this!

Sincerely yours,
ClassicSenior

11 Likes

Very cool thanks for making this man!

Do you have a video of some sorts showcasing it :smiley:

4 Likes

Im going to make one right now and put it on the post!

I have changed the post a bit and added a preview video :saluting_face:

Nice, thanks for making this! Would be a nice addition to my game :smiley:

No problem! Have fun using it!