Hi, I have this function that formats image and text colors to portray that of the players stats. Everything formats properly except for line 30 where I get the error in the title
function module.FormatUI()
local frame = game.Players.LocalPlayer.PlayerGui.Frames.Passives
local plr = game.Players.LocalPlayer
local colors = game.ReplicatedStorage.RarityGradients
local current = plr.Data.Passives.CurrentPassive
local soon = plr.Data.Passives.NextPassive
local function formatCurrent()
if plr.Data.Passives.CurrentPassive.Value == "None" then
frame.Current.Current.Text = "Equip a passive!"
frame.Current.CurrentIcon.Image = "rbxassetid://18101189951"
else
frame.Current.Current.Text = plr.Data.Passives.CurrentPassive.Value
frame.Current.CurrentIcon.Image = module.Passives[current.Value].Icon
frame.Current.Current.TextColor.Color = colors[module.Passives[current.Value].Color].Color or Color3.fromRGB(255, 255, 255)
frame.Current.CurrentIcon.ImageColor.Color = colors[module.Passives[current.Value].Color].Color or Color3.fromRGB(255, 255, 255)
end
end
local function formatNext()
if soon.Value == "None" then
frame.Next.Next.Text = "Roll a passive!"
frame.Next.NextIcon.Image = "rbxassetid://18101189951"
else
frame.Next.Next.Text = soon.Value
frame.Next.NextIcon.Image = module.Passives[soon.Value].Icon
frame.Next.NextIcon.ImageColor.Color = colors[module.Passives[soon.Value].Color].Color or Color3.fromRGB(255, 255, 255)
frame.Next.Next.TextColor.Color = colors[module.Passives[soon.Value].Color].Color or Color3.fromRGB(255, 255, 255)
end
end
formatNext()
formatCurrent()
end
Here is an example of the table
["Rich II"] = {
Icon = "rbxassetid://18100902390",
Color = "Rare",
PName = "Rich II",
Description = "10% More Money",
Chance = 10,
Gradient = nil, --Ignore, used in favor of Color
},
Heres my replicatedstorage with all the gradients
And here’s my startergui