Ok, I got the table, but now how would I choose a color from the table based off of Rarity.Value?
Nvm, found it our myself:
local Rarities = {
Common = Color3.new(2/3, 2/3, 2/3),
Uncommon = Color3.new(0.2, 0.8, 0.2),
Rare = Color3.new(0.125, 0.55, 1),
Epic = Color3.new(0.6, 0.2, 1),
Legendary = Color3.new(1, 0.55, 0),
Mythic = Color3.new(1, 0, 0)
}
for i, v in pairs(Rarities) do
if i == Rarity.Value then
TextLabel.BackgroundColor3 = v
end
end
I was writing something similar to that as you said it and yes that should be correct.
1 Like
No, ‘NewRarity’ is a reference to the value object’s new value.
https://developer.roblox.com/en-us/api-reference/event/IntValue/Changed
The ‘Changed’ event/signal works differently for value objects.