That’s because a Color3 is not a ColorSequence (obviously).
Here is what you can do:
local cs = ColorSequence.new({
ColorSequenceKeypoint.new(0,Color3.new(0,0,1)),
ColorSequenceKeypoint.new(1,Color3.new(1,0,0)),
})
local col = Color3.new(cs.Keypoints[1].Value.R,cs.Keypoints[1].Value.G,cs.Keypoints[1].Value.B)
print(col)
I’m not expecting it to succeed, just set descendants’ properties which is why I put things in a specific order for it to work out exactly how I planned
It’s usually a good practice to focus on the main issues as they are the ones that will determine the end result. Small issues are usually silent and don’t modify the end result by a ton.
local ColorValue = SpellValue.ColorValue.Value
local LightEmission = 0.75
if
(ColorValue.R * 255) <= 110
and (ColorValue.G * 255) <= 110
and (ColorValue.B * 255) <= 110
then
LightEmission = 0.25
end
local colorSequence = SpellValue:FindFirstChild("ColorSequence")
colorSequence = colorSequence and colorSequence.Color or ColorSequence.new(ColorValue)
Hm, I see now why you have used pcall. However, I still consider this code bad practice because it wasn’t obvious what the intention behind using it was. Even if you think it is obvious, you are still asking help from people online, and making your code easier to understand will make it easier to get help from other people and for other people to help you.
Additionally, because @awry_y explained the issue first, you should mark their reply as the “Solution” for other readers of this thread:
You seem to be missing the point here, I’m not looking for best practice, I know what’s the best practice and I chose readability over slight performance diff
doesn’t matter if its executed lol? execution doesnt always mean success, especially in pcall, literally thats what pcall is for, you are still not understanding what that is