So I have 4 tables of colors for the 4 seasons in my game, and they look like this,
LocalScript:
local NewYearsColors = {
"Flame reddish orange",
"Dark orange",
"Persimmon"
}
local July4thColors = {
"Royal purple",
"Bright green",
"Tr. Red"
}
local HalloweenColors = {
"Deep blue",
"Dark green",
"Br. reddish orange"
}
local ChristmasColors = {
"Medium red",
"Dove blue",
"Slime green"
}
And I am trying to set images and frame background colors to the colors in the tables above so I descied to make a module and it looks like this,
Module:
local Season = {
SeasonData = {
NewYears = false,
July4th = true,
Halloween = false,
Christmas = false,
}
}
return Season
How would I check if a Value in SeasnData is true, without making an over complicated LocalScript. Here’s what my LocalScript looks like and I feel like it’s so unefficient.
local NewYears = nil
local July4th = nil
local Halloween = nil
local Christmas = nil
if SeasonModule.SeasonData.NewYears == true then
NewYears = true
elseif SeasonModule.SeasonData.July4th == true then
July4th = true
elseif SeasonModule.SeasonData.Halloween == true then
Halloween = true
elseif SeasonModule.SeasonData.Christmas == true then
Christmas = true
end
But I am having trouble trying to tie everything together, how would I make CurrentColorGroup = to the correct Season? For example 4th of July is coming up and so how would it just change to the July4thColors color table according to the module. Hopefully this all makes sense lol…
local CurrentColorGroup = ??????????
local ChosenColor = CurrentColorGroup[math.random(1, #CurrentColorGroup)]
MainLogo.ImageColor3 = BrickColor.new(ChosenColor).Color
Top.BackgroundColor = BrickColor.new(ChosenColor)