I am working on a easy weathermodule with dynamic weather effects. The problem is, it just doesn’t work.
In the past when I was first testing it (when it didn’t check for the rain type) it worked fine, but now when I check it just doesn’t work? I honestly have no idea what is causing this.
Here is the modulescript inside replicatedstorage:
local Weather = {}
local TweenService = game:GetService("TweenService")
local RainModule = require(game.StarterPlayer.StarterPlayerScripts.RainScript.Rain)
AtmosphereTime = 4
RainStartTime = 7
RainStopTime = 7
RainSoundTime = 2
function Weather.RainStart(amount)
if amount == "Light" then
TweenService:Create(game.Lighting.Atmosphere, TweenInfo.new(AtmosphereTime), {Density = 0.415}):Play()
RainModule.SetIntensityRatio(0.250)
RainModule.SetLightEmission(0.425)
RainModule.SetLightInfluence(0.600)
RainModule.SetSpeedRatio(0.550)
RainModule.SetTransparency(0.275)
RainModule.SetVolume(0.250)
RainModule:Enable(TweenInfo.new(RainStartTime))
print("Starting Light Rain!")
elseif amount == "Medium" then
TweenService:Create(game.Lighting.Atmosphere, TweenInfo.new(AtmosphereTime), {Density = 0.477}):Play()
RainModule.SetIntensityRatio(0.500)
RainModule.SetLightEmission(0.775)
RainModule.SetLightInfluence(0.675)
RainModule.SetSpeedRatio(0.750)
RainModule.SetTransparency(0.100)
RainModule.SetVolume(0.400)
RainModule:Enable(TweenInfo.new(RainStartTime))
print("Starting Medium Rain!")
elseif amount == "Heavy" then
TweenService:Create(game.Lighting.Atmosphere, TweenInfo.new(AtmosphereTime), {Density = 0.58}):Play()
RainModule.SetIntensityRatio(0.750)
RainModule.SetLightEmission(0.775)
RainModule.SetLightInfluence(0.675)
RainModule.SetSpeedRatio(1)
RainModule.SetTransparency(0)
RainModule.SetVolume(0.550)
RainModule:Enable(TweenInfo.new(RainStartTime))
print("Starting Heavy Rain!")
elseif amount == "Extreme" then
TweenService:Create(game.Lighting.Atmosphere, TweenInfo.new(AtmosphereTime), {Density = 0.692}):Play()
RainModule.SetIntensityRatio(1)
RainModule.SetLightEmission(1)
RainModule.SetLightInfluence(1)
RainModule.SetSpeedRatio(1)
RainModule.SetTransparency(0)
RainModule.SetVolume(0.650)
RainModule:Enable(TweenInfo.new(RainStartTime))
print("Starting Extreme Rain!")
end
end
function Weather.RainStop()
RainModule:Disable(TweenInfo.new(RainStopTime))
end
return Weather
Here is the localscript inside of StarterCharacterScripts:
local WeatherHandler = require(game.ReplicatedStorage.Modules.WeatherHandler)
WeatherHandler:RainStop()
wait(3)
WeatherHandler:RainStart("Light")
wait(5)
WeatherHandler:RainStart("Medium")
wait(5)
WeatherHandler:RainStart("Heavy")
wait(5)
WeatherHandler:RainStart("Extreme")
The localscript is just for testing at the moment. I am not getting any errors. This is the module I am using for the rain