Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to get Color to BrickColor with ParticleEmitters?

Script is inside ParticleEmitter

script.Parent.Color = script.Parent.Parent.Parent.Parent.Name -- Model is named 'Teal'

Output bad argument #3 to 'Color' (ColorSequence expected, got string)

I am trying to get the ParticleEmitters color to be the same as a models name, which the models name is Teal so pretty much I want the Color to be a BrickColor

The problem I believe is that since a ParticleEmitter has a start and end property to the color it gets confused. I just want both the start and end properties to be set to the script.Parent.Parent.Parent.Parent.Name, which is Teal

  • NinjoOnline

3 answers

✓ Accepted answer

Particle emmiters use ColorSequence. So far I've been having a lot of trouble with this. Basically a ColorSequence is a combination of 2 color3 values. To access the colour, you'd have to do particleEmmiter.Color.Start or particleEmmiter.Color.End Start and End are the color 3 values that make up the ColorSequence

To get a emmiter to be the same colour as the part I'd do

local bc = BrickColor.new(script.Parent.Parent.Parent.Parent.Name)

local color = bc.Color

script.Parent.Color = ColorSequence.new(color,color)

That technically should work but I had a bit of trouble when I tried.

1 comment

1

You don't need to have the color property twice on the ColorSequence.new() line unless you're going from one color to another. The wiki states you can have one or two Color3 values as arguments for a ColorSequence.

script.Parent.Color = BrickColor.new(script.Parent.Parent.Parent.Parent.Name) --BrickColor variable

If this doesn't work, you have to use a Color3. I'm not very familiar with ParticleEmitters yet.

ParticleEmitter came with a couple new things such as NumberSequences and ColorSequences. To create a new ColorSequence, use ColorSequence.new(). It takes two arguments, which are Color3 values, the first being the StartColor, the second being the EndColor. If you choose to only use 1 argument, it will be both the start and end colors.

This discussion is preserved as it was. New answers, comments, and votes are closed.