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 7 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 7 years ago

If you want to do it in a loop ~

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

if the particle is in a model ~

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

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

you can use it like this.

script.Parent.Enabled = false -- particles dont emit
wait(3)
script.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 — 7y

Answer this question