Here's an implementation with 2 formlists and the find function instead of the If-Else chain.
You'll need to make 2 formlists though, WeatherCheckList and WeatherForceList as I named them,
And you must fill both lists in the appropriate order with the appropriate weather records.
This should work? granted I could have made a typo and I've never used the "Find" function for formlists before.
Just try it out I guess.
Scriptname GetShelterTBScript extends ObjectReference ;0416132032ACTOR PROPERTY PlayerREF AUTOGLOBALVARIABLE PROPERTY IsSheltered AUTOGLOBALVARIABLE PROPERTY ShelterSwitch AUTOGLOBALVARIABLE PROPERTY DebugMode AUTOOBJECTREFERENCE PROPERTY rainsoundfx1 AUTOOBJECTREFERENCE PROPERTY rainsoundfx2 AUTOFORMLIST PROPERTY WeatherCheckList AUTOFORMLIST PROPERTY WeatherForceList AUTOWEATHER CurrentWeatherint listIndexEvent OnTriggerEnter(ObjectReference akActionRef) If akActionRef == PlayerREF If ShelterSwitch.getvalue() == 1 Utility.wait(0.3) CurrentWeather = Weather.GetCurrentWeather() IsSheltered.setvalue(1) listIndex = WeatherCheckList.Find(Weather.GetCurrentWeather() AS FORM) If listIndex > -1 rainsoundfx1.Enable() rainsoundfx2.Enable() (WeatherForceList.GetAt(listIndex) AS WEATHER).ForceActive(True) EndIf EndIf EndIfEndEventEvent OnTrigger(ObjectReference akActionRef) If akActionRef == PlayerREF IsSheltered.setvalue(1) EndIfEndEventEvent OnTriggerLeave(ObjectReference akActionRef) If akActionRef == PlayerREF If ShelterSwitch.getvalue() == 1 Utility.wait(0.3) If IsSheltered.getvalue() != 1 IsSheltered.setvalue(0) Utility.wait(0.3) EndIf If IsSheltered.getvalue() == 0 CurrentWeather.forceactive() EndIf If Weather.GetCurrentWeather().GetClassification() == 2 rainsoundfx1.Disable() rainsoundfx2.Disable() EndIf Utility.wait(0.3) rainsoundfx1.Disable() rainsoundfx2.Disable() EndIf EndIfEndEvent
PS: no need to credit me