Color3.fromRGB acts as Color3.new?

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)
1 Like

yeah you know it’d help if you actually said something relevant to the problem if you’re going to comment about it

before fixing your main issue, start by fixing your smaller problems first :slight_smile:
next.

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

The pcall has no effect on the order of execution. You could effectively remove the pcall keyword and it would function exactly the same.

1 Like

Color3Value inside ColorSequence.new should work though no? It’d just make all the keypoints the same color no?

1 Like

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.

I didnt say it has any effect, I said I put things there in order so if it fails it’d first set all the properties I wanted it to

i just said focusing on main issues requires you to fix any smaller problems that might be the cause / root of your main problem

Yes it should and it would.

I recommend sending in the script here, not the image but copy paste it here.

I would also recommend encapsulating it in three back quotes ( ` ).

So according to this terminology the usage of pcall is termed as the root of OPs issue?

pcall(function()
				descendant.Color = typeof(descendant.Color) == "ColorSequence" and colorSequence or ColorValue

				descendant.Brightness = 0
				descendant.LightEmission = 0
				descendant.Transparency = G.MultiplyNumberSequence(descendant.Transparency, 0.9)

				descendant.Size =
					typeof(descendant.Size) == "NumberSequence"
					and G.MultiplyNumberSequence(descendant.Size, sizeMultiplier)
					or descendant.Size * sizeMultiplier

				descendant.Rate *= sizeMultiplier
				descendant.Speed = NumberRange.new(descendant.Speed.Min * sizeMultiplier, descendant.Speed.Max * sizeMultiplier)
				descendant.Lifetime = NumberRange.new(descendant.Lifetime.Min * sizeMultiplier, descendant.Lifetime.Max * sizeMultiplier)
			end)

I said I put things there in order so if it fails it’d first set all the properties I wanted it to

you are not even following up to what you are saying urself

Yeah, descendants that dont have a color to them are not expected to be edited in the first place LOL

in a way? it literally silents the error that MIGHT be the issue why its not working

The first line is always executed so no

descendant.Color = typeof(descendant.Color) == "ColorSequence" and ColorSequence.new(ColorValue) or ColorValue

descendant.Brightness = 0
descendant.LightEmission = 0
descendant.Transparency = G.MultiplyNumberSequence(descendant.Transparency, 0.9)

descendant.Size =
	typeof(descendant.Size) == "NumberSequence"
	and G.MultiplyNumberSequence(descendant.Size, sizeMultiplier)
	or descendant.Size * sizeMultiplier

descendant.Rate *= sizeMultiplier
descendant.Speed = NumberRange.new(descendant.Speed.Min * sizeMultiplier, descendant.Speed.Max * sizeMultiplier)
descendant.Lifetime = NumberRange.new(descendant.Lifetime.Min * sizeMultiplier, descendant.Lifetime.Max * sizeMultiplier)

A bit edited but can you please send the entire code? I don’t know what “ColorValue” is.

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)

the only reason you could use a pcall in here that is reasonable is to check if the descendant has the property, instead of supressing the whole body

local hasPropery = pcall(function()
     return descendant["Color"]
end)

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