local P=require(script.Rain)P:SetColor(Color3.fromRGB(script.Color.Value.x,script.Color.Value.y,script.Color.Value.z))P:SetDirection(script.Direction.Value)P:SetTransparency(script.Transparency.Value)P:SetSpeedRatio(script.SpeedRatio.Value)P:SetIntensityRatio(script.IntensityRatio.Value)P:SetLightInfluence(script.LightInfluence.Value)P:SetLightEmission(script.LightEmission.Value)P:SetVolume(script.Volume.Value)P:SetSoundId(script.SoundId.Value)P:SetStraightTexture(script.StraightTexture.Value)P:SetTopDownTexture(script.TopDownTexture.Value)P:SetSplashTexture(script.SplashTexture.Value)local x=script.TransparencyThreshold.Value if script.TransparencyConstraint.Value and script.CanCollideConstraint.Value then P:SetCollisionMode(P.CollisionMode.Function,function(P)return P.Transparency<=x and P.CanCollide end)elseif script.TransparencyConstraint.Value then P:SetCollisionMode(P.CollisionMode.Function,function(P)return P.Transparency<=x end)elseif script.CanCollideConstraint.Value then P:SetCollisionMode(P.CollisionMode.Function,function(P)return P.CanCollide end)end

local Rain = require(script.Rain)

Rain:SetColor(Color3.fromRGB(script.Color.Value.x, script.Color.Value.y, script.Color.Value.z))
Rain:SetDirection(script.Direction.Value)

Rain:SetTransparency(script.Transparency.Value)
Rain:SetSpeedRatio(script.SpeedRatio.Value)
Rain:SetIntensityRatio(script.IntensityRatio.Value)
Rain:SetLightInfluence(script.LightInfluence.Value)
Rain:SetLightEmission(script.LightEmission.Value)

Rain:SetVolume(script.Volume.Value)

Rain:SetSoundId(script.SoundId.Value)
Rain:SetStraightTexture(script.StraightTexture.Value)
Rain:SetTopDownTexture(script.TopDownTexture.Value)
Rain:SetSplashTexture(script.SplashTexture.Value)

local threshold = script.TransparencyThreshold.Value
if script.TransparencyConstraint.Value and script.CanCollideConstraint.Value then
	Rain:SetCollisionMode(
		Rain.CollisionMode.Function,
		function(p)
			return p.Transparency <= threshold and p.CanCollide
		end
	)
elseif script.TransparencyConstraint.Value then
	Rain:SetCollisionMode(
		Rain.CollisionMode.Function,
		function(p)
			return p.Transparency <= threshold
		end
	)
elseif script.CanCollideConstraint.Value then
	Rain:SetCollisionMode(
		Rain.CollisionMode.Function,
		function(p)
			return p.CanCollide
		end
	)
end
