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

Can you enable and disable a particle emitter in a loop script?

Asked by 8 years ago

I wanted to have a winter breathing effect and I was wondering if you could enable and disable the particle effect in a loop, to activate every like 15 seconds or something.

2 answers

Log in to vote
0
Answered by 8 years ago

If you want to do it in a loop ~

1repeat -- This is what triggers the loop
2    script.Parent.Enabled = false -- The particle is off
3wait (15) -- This is how long you have to wait, change the number if you want to make it longer/shorter
4    script.Parent.Enabled = true -- Particle ends on a true variable therefore it will continue to loop
5until false -- The loop won't end until the particle ends on a false variable

if the particle is in a model ~

1repeat
2    script.Parent.Parent.ParticleEmitter.Enabled = false
3wait(15)
4    script.Parent.Parent.ParticleEmitter.Enabled = true
5until false
0
Thanks so much :) GottaHaveAFunTime 218 — 8y
0
Happy to help! =^) Skepticlemon 24 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

There is a property in the Particle etmitter called "Enabled"

you can use it like this.

1script.Parent.Enabled = false -- particles dont emit
2wait(3)
3script.Parent.Enabled = true -- WOAH THEY START ETMITTING

i hope this helps you.

0
I never thought it was that simple.... I am amazed XD GottaHaveAFunTime 218 — 8y

Answer this question