Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why isn't this particle emitter color changer isn't working?

Asked by 3 years ago

I'm trying to make a very basic Particle emitter color changing script which takes a particle emitter's color out of a block and makes it the color of the particle emitter that's touching the block. I'm trying to take the ColorSequence from the particle emitter inside of the block but I'm not sure why it doesnt copy the color over. Am I missing code on line 4?


local Reference = script.Parent.ParticleEmitter function onTouched(part) if(part.Name ~="Aura") then return end part.AuraParticle.ColorSequence = Reference.ColorSequence end script.Parent.Touched:connect(onTouched)

1 answer

Log in to vote
1
Answered by
Optikk 499 Donator Moderation Voter
3 years ago
Edited 3 years ago

There's two potential issues I've spotted in your code.

    if(part.Name ~="Aura") then return end
    part.AuraParticle.ColorSequence = Reference.ColorSequence
end 

I'm assuming AuraParticle is a ParticleEmitter. ParticleEmitters don't have a ColorSequence property. Try using the Color property.

The other potential issue is that the particle emitter's parent BaseParts may not be named "Aura", which would return before the color is ever changed in the onTouched function. It's more likely that the former is the problem, though.

Let me know if you want me to clarify anything. Hope this helps!

0
It worked! Thank you. Pyro_dood 31 — 3y
Ad

Answer this question