Invalid argument #2 to 'random' (interval is empty) Picking random Table

The title says it all i tried this but it prints that error

local WeatherData = {
    ["Weather"] = {
        BaseWeather = {
            Raining = false;
            RainIntensity = 0;
            EventName = "Base"
        };
        Raining = {
            Raining = true;
            RainIntensity = 4;
            EventName = "Rainning"
        }
    }
}
return WeatherData
print(WeatherData.Weather[math.random(1, #WeatherData.Weather)])

# doesn’t work on dictionaries. The best solution would be to create a list of each key in the dictionary then use that

local dict = {
  foo = "bar",
  no = 0
}

local keys = {"foo", "no"}

local randomItem = dict[keys[math.random(1, #keys)]]
3 Likes