I need help making the rain effects work

game.Players:PlayerAdded:Connect(function(plr)
local character = plr.Character
end)

and make it parent it to the character, and then the code of the local script will run

how do i fix this now

can you show the code you used for parenting it to the character?

this is the weather handler (mainscript)

	-- Services --
	
	local Lighting = game:GetService("Lighting")
	local SSS = game:GetService("ServerScriptService")
	local Rep = game:GetService("ReplicatedStorage")
	local SS = game:GetService("ServerStorage")
	local SG = game:GetService("StarterGui")
	local Clouds = workspace.Terrain.Clouds
	local character = plr.Character

	-- Main --

	local function startlightrain()
		local rain = script.rain
		Clouds.Cover = 1
		Clouds.Density = 1
		Clouds.Color = Color3.fromRGB(93, 93, 93)
		rain.Parent = game.StarterPlayer.StarterCharacterScripts
		local chancetostop1 = math.random(1,20000)
		if chancetostop1 == 1 then
			rain.Parent = character
		end
	end

	while true do
		wait(0.8)
		local chancetostart1 = math.random(1, 5)
		if chancetostart1 == 1 then
			startlightrain()
		end
	end

	-- Custom --

end)