Hello, I wanted to make a automatic rarity system that takes the stringvalue of an item, gets its rarity and then it SHOULD set the background color of the item, but it doesn't because im getting an error. The script:
local guipart = script.Parent.GuiPart
local StatsFolder = script.Parent.Stats
local rarity = StatsFolder.Rarity
local itemname = StatsFolder.ItemName
local newRarity = string.upper(rarity.Value)
local newName = string.upper(itemname.Value)
print(workspace.RarityColors.Background.COMMON.Value.R * 255, workspace.RarityColors.Background.COMMON.Value.G * 255, workspace.RarityColors.Background.COMMON.Value.B * 255)
guipart.ItemInfoGUI.Background.Rarity.Text = newRarity
guipart.ItemInfoGUI.Background.ItemName.Text = newName
guipart.ItemInfoGUI.Background.BackgroundColor3.R = Color3.new(workspace.RarityColors.Background[newRarity].Value.R * 255)
guipart.ItemInfoGUI.Background.BackgroundColor3.G = Color3.new(workspace.RarityColors.Background[newRarity].Value.G * 255)
guipart.ItemInfoGUI.Background.BackgroundColor3.B = Color3.new(workspace.RarityColors.Background[newRarity].Value.B * 255)
guipart.ItemInfoGUI.Overline.BackgroundColor3 = Color3.new(workspace.RarityColors.Overline[newRarity].Value)

2 comments
By the way, it sets the background color to like 40 thousand.
Did you mean to do Color3.new or do you want Color3.fromRGB?