The Enabled property, much like
ParticleEmitter/Enabled, determines whether smoke particles are emit. Any particles already emit will continue to render until their lifetime expires. This property is useful for keeping pre-made smoke effects off until they are needed later. Since smoke particles are destroyed when the
Instance/Parent is set to nil, this property is useful in allowing existing particles the opportunity to expire before destroying the Fire object altogether. See the function below.
local Debris = game:GetService("Debris") local part = script.Parent function stopSmoke(smoke) smoke.Enabled = false -- No more new particles Debris:AddItem(smoke, 10) -- Remove the object after a delay (after existing particles have expired) end stopSmoke(part.Smoke)
Add Smoke to All Fire
This code sample adds a
Smoke object to every
Fire object in the
Workspace. It does this by using a recursive search.