Need Particle Emitter to only be ENABLED when its parent ISN'T Transparent?
Asked by
3 years ago Edited 3 years ago
I've been trying to write a code which turns on/off the particle emitter depending on its parents transparency.
I want it so that if the parents transparency ==1 then the particle emitter is disabled, and the opposite if the parents transparency is ==0.
I am not too experienced in scripting lua and I just cannot figure this out. I also tried putting it in a while true do but that also doesn't work. Can anyone propose a fix/ something different?
Thank you for reading :)
This is what I have come up with:
1 | local part = script.Parent |
2 | local particles = part.ParticleEmitter |
4 | if part.Transparency = = 1 then |
5 | particles.Enabled = false |
6 | elseif part.Transparency = = 0 then |
7 | particles.Enabled = true |